Improve Windows implementation of message()

This commit is contained in:
Peter Dimov
2018-09-21 06:45:56 +03:00
parent e180bfe37e
commit 7b401cef93
2 changed files with 57 additions and 10 deletions
+5 -1
View File
@@ -14,6 +14,7 @@
#include <boost/system/error_code.hpp>
#include <boost/core/lightweight_test.hpp>
#include <cstring>
#include <cstdio>
//
@@ -51,7 +52,10 @@ std::string sys_strerror( int ev )
if( retval == 0 )
{
return "Unknown error";
char buffer[ 38 ];
std::sprintf( buffer, "Unknown error (%d)", ev );
return buffer;
}
std::string str( static_cast<char const*>( lpMsgBuf ) );