fixed two warnings

This commit is contained in:
thrust26 2018-09-01 14:20:30 +02:00
parent 2c8a567810
commit 492596011a
2 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ ZipHandler::zip_error ZipHandler::zip_file_open(const char* filename, zip_file**
goto error; goto error;
} }
strcpy(string, filename); strcpy_s(string, strlen(filename) + 1, filename);
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(_history[_historyIndex], str, kLineBufferSize-1); //FIXME - unsafe function strncpy_s(_history[_historyIndex], str, kLineBufferSize - 1);
_historyIndex = (_historyIndex + 1) % kHistorySize; _historyIndex = (_historyIndex + 1) % kHistorySize;
_historyLine = 0; _historyLine = 0;