diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-18 05:32:29 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-05-18 05:32:29 +0000 |
commit | cc355f947ec8914f6410fa887eb64e79f53ceadd (patch) | |
tree | 761e678536216adccc9990d38a5eb446d329ed5e /capture_sync.c | |
parent | 7b76fe48a6bf477686e0e6abd33fb7225d38e937 (diff) |
Fix some errors. Use FormatMessageA(), as we need the string in ASCII.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32857 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'capture_sync.c')
-rw-r--r-- | capture_sync.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/capture_sync.c b/capture_sync.c index e4fe43c496..f2bda8614f 100644 --- a/capture_sync.c +++ b/capture_sync.c @@ -219,13 +219,12 @@ protect_arg (const gchar *argv) static char * win32strerror(DWORD error) { - DWORD error; static char errbuf[ERRBUF_SIZE+1]; - int errlen; + size_t errlen; char *p; - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errbuf, - ERRBUF_SIZE, NULL); + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error, 0, errbuf, + ERRBUF_SIZE, NULL); /* * "FormatMessage()" "helpfully" sticks CR/LF at the end of the @@ -237,7 +236,7 @@ win32strerror(DWORD error) errbuf[errlen - 2] = '\0'; } p = strchr(errbuf, '\0'); - g_snprintf(p, sizeof errbuf - (p-errbuf), " (%lu)", error); + g_snprintf(p, (gulong)(sizeof errbuf - (p-errbuf)), " (%lu)", error); return errbuf; } #endif |