summaryrefslogtreecommitdiff
path: root/capture_sync.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-05-18 05:32:29 +0000
committerGuy Harris <guy@alum.mit.edu>2010-05-18 05:32:29 +0000
commit414399b572b576c3705b2502c6255d1665e2bb39 (patch)
tree761e678536216adccc9990d38a5eb446d329ed5e /capture_sync.c
parentece9788353261d3fd515e5f26ec4d083032a5d75 (diff)
downloadwireshark-414399b572b576c3705b2502c6255d1665e2bb39.tar.gz
Fix some errors. Use FormatMessageA(), as we need the string in ASCII.
svn path=/trunk/; revision=32857
Diffstat (limited to 'capture_sync.c')
-rw-r--r--capture_sync.c9
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