Skip to content

Commit

Permalink
Correctly null-terminate error message string
Browse files Browse the repository at this point in the history
  • Loading branch information
briangreenery committed Oct 4, 2015
1 parent 7f6e2b7 commit 5ab25b6
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions Library/BigFix/WindowsFilesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,9 @@ static std::string ErrorString( int errnum )

char buffer8[1024];

if ( WideCharToMultiByte( CP_UTF8,
0,
buffer16,
length16,
buffer8,
sizeof( buffer8 ),
NULL,
NULL ) == 0 )
if ( WideCharToMultiByte(
CP_UTF8, 0, buffer16, -1, buffer8, sizeof( buffer8 ), NULL, NULL ) ==
0 )
{
return "Unknown error";
}
Expand Down

0 comments on commit 5ab25b6

Please sign in to comment.