Change uses of std::sprintf in tests to boost::core::snprintf, to avoid deprecation warnings

This commit is contained in:
Peter Dimov
2023-01-20 02:29:38 +02:00
parent 3e6af15652
commit fb648760b5
5 changed files with 11 additions and 21 deletions
+2 -4
View File
@@ -8,11 +8,9 @@
// See library home page at http://www.boost.org/libs/system
// Avoid spurious VC++ warnings
# define _CRT_SECURE_NO_WARNINGS
#include <boost/system/error_code.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/snprintf.hpp>
#include <cstring>
#include <cstdio>
@@ -65,7 +63,7 @@ std::string sys_strerror( int ev )
{
char buffer[ 38 ];
std::sprintf( buffer, "Unknown error (%d)", ev );
boost::core::snprintf( buffer, sizeof( buffer ), "Unknown error (%d)", ev );
return buffer;
}