Get rid of strlen_s and strnlen_s, don't drive audio if sound is disabled.

This commit is contained in:
Christian Speckner 2018-09-01 23:12:52 +02:00
parent 492596011a
commit 28f8dcc312
4 changed files with 7 additions and 4 deletions

View File

@ -59,6 +59,7 @@
"iostream": "cpp", "iostream": "cpp",
"cstdint": "cpp", "cstdint": "cpp",
"ostream": "cpp", "ostream": "cpp",
"__memory": "cpp" "__memory": "cpp",
"iosfwd": "cpp"
} }
} }

View File

@ -256,7 +256,7 @@ ZipHandler::zip_error ZipHandler::zip_file_open(const char* filename, zip_file**
goto error; goto error;
} }
strcpy_s(string, strlen(filename) + 1, filename); strncpy(string, filename, strlen(filename) + 1);
newzip->filename = string; newzip->filename = string;
*zip = newzip; *zip = newzip;

View File

@ -689,7 +689,7 @@ void PromptWidget::textPaste()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PromptWidget::addToHistory(const char* str) void PromptWidget::addToHistory(const char* str)
{ {
strncpy_s(_history[_historyIndex], str, kLineBufferSize - 1); strncpy(_history[_historyIndex], str, kLineBufferSize - 1);
_historyIndex = (_historyIndex + 1) % kHistorySize; _historyIndex = (_historyIndex + 1) % kHistorySize;
_historyLine = 0; _historyLine = 0;

View File

@ -1242,7 +1242,9 @@ void TIA::cycle(uInt32 colorClocks)
if (++myHctr >= 228) if (++myHctr >= 228)
nextLine(); nextLine();
myAudio.tick(); #ifdef SOUND_SUPPORT
myAudio.tick();
#endif
++myTimestamp; ++myTimestamp;
} }