diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2021-01-21 02:46:07 -0500 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2021-01-22 01:47:04 -0500 |
commit | d3a3bdb5ef867e270f4be205f36024ad1e48beb3 (patch) | |
tree | 73ed1ab5fa69a69ecb797461e4253d0dca857d2b | |
parent | b97a60f5f4d3fb63002bc76fcbc6cdeb4572189e (diff) | |
download | curl-d3a3bdb5ef867e270f4be205f36024ad1e48beb3.tar.gz |
strerror: skip errnum >= 0 assertion on windows
On Windows an error number may be greater than INT_MAX and negative once
cast to int.
The assertion is checked only in debug builds.
Closes https://github.com/curl/curl/pull/6504
-rw-r--r-- | lib/strerror.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/strerror.c b/lib/strerror.c index 9b2fc26c2..0216c7193 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -721,7 +721,9 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) if(!buflen) return NULL; +#ifndef WIN32 DEBUGASSERT(err >= 0); +#endif max = buflen - 1; *buf = '\0'; |