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
This commit is contained in:
Jay Satiro 2021-01-21 02:46:07 -05:00
parent b97a60f5f4
commit d3a3bdb5ef
1 changed files with 2 additions and 0 deletions

View File

@ -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';