3rdparty/SimpleINI: Replace sprintf() with snprintf()

This commit is contained in:
Stenzek 2023-10-02 02:04:27 +10:00 committed by Connor McLaughlin
parent 5690742937
commit e8201b115f
1 changed files with 2 additions and 10 deletions

View File

@ -2073,11 +2073,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::SetLongValue(
// convert to an ASCII string
char szInput[64];
#if __STDC_WANT_SECURE_LIB__ && !_WIN32_WCE
sprintf_s(szInput, a_bUseHex ? "0x%lx" : "%ld", a_nValue);
#else // !__STDC_WANT_SECURE_LIB__
sprintf(szInput, a_bUseHex ? "0x%lx" : "%ld", a_nValue);
#endif // __STDC_WANT_SECURE_LIB__
snprintf(szInput, sizeof(szInput), a_bUseHex ? "0x%lx" : "%ld", a_nValue);
// convert to output text
SI_CHAR szOutput[64];
@ -2135,11 +2131,7 @@ CSimpleIniTempl<SI_CHAR,SI_STRLESS,SI_CONVERTER>::SetDoubleValue(
// convert to an ASCII string
char szInput[64];
#if __STDC_WANT_SECURE_LIB__ && !_WIN32_WCE
sprintf_s(szInput, "%f", a_nValue);
#else // !__STDC_WANT_SECURE_LIB__
sprintf(szInput, "%f", a_nValue);
#endif // __STDC_WANT_SECURE_LIB__
snprintf(szInput, sizeof(szInput), "%f", a_nValue);
// convert to output text
SI_CHAR szOutput[64];