Merge pull request #51 from biodranik/sprintf-warning-fix

Replaced sprintf with snprintf to silent the security deprecated warning in Xcode 14
This commit is contained in:
Antony Polukhin 2022-08-31 21:27:53 +03:00 committed by GitHub
commit e67d186e0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,7 +282,7 @@ namespace boost {
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
sprintf_s(begin, CharacterBufferSize,
#else
sprintf(begin,
snprintf(begin, CharacterBufferSize,
#endif
"%.*g", static_cast<int>(boost::detail::lcast_get_precision<float>()), val_as_double);
return finish > start;
@ -294,7 +294,7 @@ namespace boost {
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
sprintf_s(begin, CharacterBufferSize,
#else
sprintf(begin,
snprintf(begin, CharacterBufferSize,
#endif
"%.*g", static_cast<int>(boost::detail::lcast_get_precision<double>()), val);
return finish > start;
@ -307,7 +307,7 @@ namespace boost {
#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
sprintf_s(begin, CharacterBufferSize,
#else
sprintf(begin,
snprintf(begin, CharacterBufferSize,
#endif
"%.*Lg", static_cast<int>(boost::detail::lcast_get_precision<long double>()), val );
return finish > start;