]> git.ipfire.org Git - thirdparty/curl.git/commit
strerror: use sys_errlist instead of strerror on Windows
authorJay Satiro <raysatiro@yahoo.com>
Fri, 17 Sep 2021 03:47:08 +0000 (23:47 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 17 Sep 2021 07:44:54 +0000 (03:44 -0400)
commitb0eda8dc6eb7be3d3e0762be5fb2a60989c2f77b
tree6bca73b524e71e29816f3f1c8a1d27de3ec6a767
parent4a4617756acd49abcee478e8d40f2061aa5413e7
strerror: use sys_errlist instead of strerror on Windows

- Change Curl_strerror to use sys_errlist[errnum] instead of strerror to
  retrieve the error message on Windows.

Windows' strerror writes to a static buffer and is not thread-safe.

Follow-up to 2f0bb86 which removed most instances of strerror in favor
of calling Curl_strerror (which calls strerror_r for other platforms).

Ref: https://github.com/curl/curl/pull/7685
Ref: https://github.com/curl/curl/commit/2f0bb86

Closes https://github.com/curl/curl/pull/7735
lib/strerror.c