Skip to content

Commit

Permalink
Minor Windows fix (thanks, fydo!).
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 13, 2008
1 parent 81d6df6 commit 0e72067
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -4,6 +4,7 @@

-- stuff in the stable-1.0 branch, backported from 2.0.0 dev branch, etc ---

02132008 - Minor Windows fix (thanks, fydo!).
01222008 - Added zlib README, and updated LICENSE.txt.
01212008 - Fixed HTTP header in physfshttpd.c.
12112007 - Fixed incorrect directory test in Windows code (thanks, Buginator!).
Expand Down
6 changes: 4 additions & 2 deletions platform/win32.c
Expand Up @@ -78,8 +78,7 @@ static const char *win32strerror(void)
{
static TCHAR msgbuf[255];
TCHAR *ptr = msgbuf;

FormatMessage(
DWORD rc = FormatMessage(
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
Expand All @@ -90,6 +89,9 @@ static const char *win32strerror(void)
NULL
);

if (rc == 0)
msgbuf = '\0'; /* oh well. */

/* chop off newlines. */
for (ptr = msgbuf; *ptr; ptr++)
{
Expand Down

0 comments on commit 0e72067

Please sign in to comment.