Skip to content

Commit

Permalink
Merge pull request #51 from biodranik/sprintf-warning-fix
Browse files Browse the repository at this point in the history
Replaced sprintf with snprintf to silent the security deprecated warning in Xcode 14
  • Loading branch information
apolukhin committed Aug 31, 2022
2 parents a9f2961 + 3f0026e commit e67d186
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit e67d186

Please sign in to comment.