diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2021-09-22 06:10:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-09-24 14:03:55 (GMT) |
commit | c4f76b28dcabdf9513a244eb1ce7d1431ae4d84d (patch) | |
tree | e6c32f13cdc2b226f2a69720b87b7f4b65ec32e8 /lib/strerror.c | |
parent | 386467c9dc939cd20711c451dd7d60341fd0e802 (diff) | |
download | CMake-c4f76b28dcabdf9513a244eb1ce7d1431ae4d84d.zip CMake-c4f76b28dcabdf9513a244eb1ce7d1431ae4d84d.tar.gz CMake-c4f76b28dcabdf9513a244eb1ce7d1431ae4d84d.tar.bz2 |
curl 2021-09-22 (c7aef0a9)
Code extracted from:
https://github.com/curl/curl.git
at commit c7aef0a945f9b6fb6d3f91716a21dfe2f4ea635f (curl-7_79_1).
Diffstat (limited to 'lib/strerror.c')
-rw-r--r-- | lib/strerror.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/strerror.c b/lib/strerror.c index 431ff1c..8a27197 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -731,12 +731,11 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) max = buflen - 1; *buf = '\0'; - /* !checksrc! disable STRERROR 2 */ #if defined(WIN32) || defined(_WIN32_WCE) #if defined(WIN32) /* 'sys_nerr' is the maximum errno number, it is not widely portable */ if(err >= 0 && err < sys_nerr) - strncpy(buf, strerror(err), max); + strncpy(buf, sys_errlist[err], max); else #endif { @@ -787,6 +786,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) } #else { + /* !checksrc! disable STRERROR 1 */ const char *msg = strerror(err); if(msg) strncpy(buf, msg, max); |