1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Gisle Vanem caught me breaking the windows version of Curl_strerror()

This commit is contained in:
Daniel Stenberg 2004-04-06 12:02:36 +00:00
parent 780b962336
commit ca7f0852df

View File

@ -510,7 +510,9 @@ const char *Curl_strerror(struct connectdata *conn, int err)
#if defined(WIN32) && !defined(__CYGWIN__) #if defined(WIN32) && !defined(__CYGWIN__)
/* 'sys_nerr' is the maximum errno number, it is not widely portable */ /* '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) && if (!get_winsock_error (err, buf, max) &&
!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err, !FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, NULL, err,
LANG_NEUTRAL, buf, max, NULL)) LANG_NEUTRAL, buf, max, NULL))