Merge branch 'develop' into feature/issue-102

This commit is contained in:
Peter Dimov
2023-01-20 04:38:15 +02:00
5 changed files with 11 additions and 21 deletions

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 <cstdio>
//
@ -31,7 +29,7 @@ public:
virtual std::string message( int ev ) const
{
char buffer[ 256 ];
std::sprintf( buffer, "user message %d", ev );
boost::core::snprintf( buffer, sizeof( buffer ), "user message %d", ev );
return buffer;
}

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_category.hpp>
#include <boost/core/lightweight_test.hpp>
#include <boost/core/snprintf.hpp>
#include <cstdio>
//
@ -31,7 +29,7 @@ public:
virtual std::string message( int ev ) const
{
char buffer[ 256 ];
std::sprintf( buffer, "user message %d", ev );
boost::core::snprintf( buffer, sizeof( buffer ), "user message %d", ev );
return buffer;
}

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;
}

View File

@ -8,9 +8,6 @@
// 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/config.hpp>
#include <boost/config/pragma_message.hpp>
@ -30,6 +27,7 @@ int main()
#else
#include <boost/core/lightweight_test.hpp>
#include <boost/core/snprintf.hpp>
#include <system_error>
#include <cerrno>
#include <string>
@ -127,7 +125,7 @@ public:
virtual std::string message( int ev ) const
{
char buffer[ 256 ];
std::sprintf( buffer, "user message %d", ev );
boost::core::snprintf( buffer, sizeof( buffer ), "user message %d", ev );
return buffer;
}
@ -267,7 +265,7 @@ public:
virtual std::string message( int ev ) const
{
char buffer[ 256 ];
std::sprintf( buffer, "user2 message %d", ev );
boost::core::snprintf( buffer, sizeof( buffer ), "user2 message %d", ev );
return buffer;
}

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;
}