From d3a3bdb5ef867e270f4be205f36024ad1e48beb3 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Thu, 21 Jan 2021 02:46:07 -0500 Subject: 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 --- lib/strerror.c | 2 ++ 1 file changed, 2 insertions(+) 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'; -- cgit v1.2.1