diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-04-06 12:02:36 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-04-06 12:02:36 +0000 |
commit | ca7f0852df06c59ba7583fa68359d39dbfc4b148 (patch) | |
tree | 9b1163914f3e1524874fd5cd11cddb7647aced33 /lib | |
parent | 780b962336cfe614406b0e56fde3f0a130693d6c (diff) | |
download | curl-ca7f0852df06c59ba7583fa68359d39dbfc4b148.tar.gz |
Gisle Vanem caught me breaking the windows version of Curl_strerror()
Diffstat (limited to 'lib')
-rw-r--r-- | lib/strerror.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/strerror.c b/lib/strerror.c index 03ddc1a2b..5e734faa7 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -510,7 +510,9 @@ const char *Curl_strerror(struct connectdata *conn, int err) #if defined(WIN32) && !defined(__CYGWIN__) /* 'sys_nerr' is the maximum errno number, it is not widely portable */ - if (err >= 0 && err < sys_nerr) { + if (err >= 0 && err < sys_nerr) + strncpy(buf, strerror(err), max); + else { if (!get_winsock_error (err, buf, max) && !FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, LANG_NEUTRAL, buf, max, NULL)) |