From 353d1f300549f23b7c8c2914fa5d19f5ec6aa48b Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 22 Feb 2023 13:53:37 +1100 Subject: Remove _CRT_SECURE_NO_DEPRECATE. Replace [v]sprintf with bounds checked [v]snprintf. --- qt/ScintillaEditBase/PlatQt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt/ScintillaEditBase/PlatQt.cpp') diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 3a4889ca6..652c7c305 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -1332,7 +1332,7 @@ void Platform::DebugPrintf(const char *format, ...) noexcept char buffer[2000]; va_list pArguments{}; va_start(pArguments, format); - vsprintf(buffer, format, pArguments); + vsnprintf(buffer, std::size(buffer), format, pArguments); va_end(pArguments); Platform::DebugDisplay(buffer); } @@ -1345,7 +1345,7 @@ bool Platform::ShowAssertionPopUps(bool /*assertionPopUps*/) noexcept void Platform::Assert(const char *c, const char *file, int line) noexcept { char buffer[2000]; - sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); + snprintf(buffer, std::size(buffer), "Assertion [%s] failed at %s %d", c, file, line); if (Platform::ShowAssertionPopUps(false)) { QMessageBox mb("Assertion Failure", buffer, QMessageBox::NoIcon, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); -- cgit v1.2.3