From e097f720bbeb02e474b9dd91a70d154df8075301 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 2 Oct 2023 12:44:56 +1000 Subject: [PATCH] dep/simpleini: Replace sprintf() with snprintf() --- dep/simpleini/include/SimpleIni.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/dep/simpleini/include/SimpleIni.h b/dep/simpleini/include/SimpleIni.h index 99356cecc..72148df19 100644 --- a/dep/simpleini/include/SimpleIni.h +++ b/dep/simpleini/include/SimpleIni.h @@ -2073,11 +2073,7 @@ CSimpleIniTempl::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::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];