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
@@ -2,11 +2,9 @@
// Copyright 2018 Peter Dimov.
// Distributed under the Boost Software License, Version 1.0.
// 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 <cstdio>
using namespace boost::system;
@@ -28,7 +26,7 @@ struct http_category_impl: public error_category
{
char buffer[ 32 ];
std::sprintf( buffer, "HTTP/1.0 %d", ev );
boost::core::snprintf( buffer, sizeof( buffer ), "HTTP/1.0 %d", ev );
return buffer;
}