]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/server/util: fix Windows Unicode build
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Wed, 10 Apr 2019 17:26:35 +0000 (19:26 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Thu, 11 Apr 2019 19:03:20 +0000 (21:03 +0200)
Always use the ANSI version of FormatMessage as we don't have the
curl_multibyte gear available here.

Closes https://github.com/curl/curl/pull/3758

tests/server/util.c

index c3935f58aecc89978520f0179c420f844055c66e..b061338022ebd00b73f2b62c2ddafa7126ab9bd5 100644 (file)
@@ -150,8 +150,8 @@ void win32_perror(const char *msg)
   char buf[512];
   DWORD err = SOCKERRNO;
 
-  if(!FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
-                    LANG_NEUTRAL, buf, sizeof(buf), NULL))
+  if(!FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
+                     LANG_NEUTRAL, buf, sizeof(buf), NULL))
     msnprintf(buf, sizeof(buf), "Unknown error %lu (%#lx)", err, err);
   if(msg)
     fprintf(stderr, "%s: ", msg);