C++: replace deprecated vsprintf and sprintf

With future C++ compilers the methods vsprintf and sprintf are declared as deprecated due to security issues.
They are replaced with the secure counterpart of the fmt library

Fixes the compiler warnings -Wdeprecated-declarations
This commit is contained in:
wmayer
2024-04-03 07:29:10 +02:00
committed by wwmayer
parent 8f82109248
commit 4263ab1937
4 changed files with 18 additions and 12 deletions

View File

@@ -893,7 +893,7 @@ int System::Sprintf (char* acDst, size_t uiDstSize, const char* acFormat, ...)
#ifdef WM4_USING_VC80
int iNumWritten = vsprintf_s(acDst,uiDstSize,acFormat,acArgs);
#else
int iNumWritten = vsprintf(acDst,acFormat,acArgs);
int iNumWritten = vsnprintf(acDst,uiDstSize,acFormat,acArgs);
#endif
va_end(acArgs);