Loading lib/curl_strerror.c +6 −2 Original line number Diff line number Diff line Loading @@ -20,8 +20,9 @@ * ***************************************************************************/ #include <curl/curl.h> #include "setup.h" #include <curl/curl.h> #include <stdlib.h> #include <string.h> #include <errno.h> Loading Loading @@ -503,7 +504,10 @@ const char *Curl_strerror(struct connectdata *conn, int err) if (err >= 0 && err < sys_nerr) { /* These should be atomic and hopefully thread-safe */ #ifdef HAVE_STRERROR_R strerror_r(err, buf, max); /* this may set ERANGE! */ strerror_r(err, buf, max); /* this may set errno to ERANGE if insufficient storage was supplied via strerrbuf and buflen to contain the generated message string, or EINVAL if the value of errnum is not a valid error number.*/ #else strncpy(buf, strerror(err), max); #endif Loading Loading
lib/curl_strerror.c +6 −2 Original line number Diff line number Diff line Loading @@ -20,8 +20,9 @@ * ***************************************************************************/ #include <curl/curl.h> #include "setup.h" #include <curl/curl.h> #include <stdlib.h> #include <string.h> #include <errno.h> Loading Loading @@ -503,7 +504,10 @@ const char *Curl_strerror(struct connectdata *conn, int err) if (err >= 0 && err < sys_nerr) { /* These should be atomic and hopefully thread-safe */ #ifdef HAVE_STRERROR_R strerror_r(err, buf, max); /* this may set ERANGE! */ strerror_r(err, buf, max); /* this may set errno to ERANGE if insufficient storage was supplied via strerrbuf and buflen to contain the generated message string, or EINVAL if the value of errnum is not a valid error number.*/ #else strncpy(buf, strerror(err), max); #endif Loading