Minor Windows fix (thanks, fydo!). stable-1.0
authorRyan C. Gordon <icculus@icculus.org>
Wed, 13 Feb 2008 05:48:57 +0000
branchstable-1.0
changeset 925 2efbe76dcd67
parent 922 46b6a770f868
child 927 8867d6c60ebf
Minor Windows fix (thanks, fydo!).
CHANGELOG
platform/win32.c
--- a/CHANGELOG	Wed Jan 23 05:14:15 2008 +0000
+++ b/CHANGELOG	Wed Feb 13 05:48:57 2008 +0000
@@ -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!).
--- a/platform/win32.c	Wed Jan 23 05:14:15 2008 +0000
+++ b/platform/win32.c	Wed Feb 13 05:48:57 2008 +0000
@@ -78,8 +78,7 @@
 {
     static TCHAR msgbuf[255];
     TCHAR *ptr = msgbuf;
-
-    FormatMessage(
+    DWORD rc = FormatMessage(
         FORMAT_MESSAGE_FROM_SYSTEM |
         FORMAT_MESSAGE_IGNORE_INSERTS,
         NULL,
@@ -90,6 +89,9 @@
         NULL 
     );
 
+    if (rc == 0)
+        msgbuf = '\0';  /* oh well. */
+
         /* chop off newlines. */
     for (ptr = msgbuf; *ptr; ptr++)
     {