From b532d5a6ee83b69a850d31fea0b33d91d5a97f10 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Wed, 14 Aug 2019 18:10:56 -0230 Subject: [PATCH] Fix compile warning for strncpy in Visual Studio. Hopefully this will make Thomas happy :) --- src/debugger/gui/PromptWidget.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index a9740ca44..1af8decc3 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -689,7 +689,11 @@ void PromptWidget::textPaste() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PromptWidget::addToHistory(const char* str) { +#if defined(BSPF_WINDOWS) + strncpy_s(_history[_historyIndex], kLineBufferSize, str, kLineBufferSize - 1); +#else strncpy(_history[_historyIndex], str, kLineBufferSize - 1); +#endif _historyIndex = (_historyIndex + 1) % kHistorySize; _historyLine = 0;