curl/lib/curlx
Viktor Szakats 1eca08a541
curlx/strerr: use strerror_s() on Windows
To replace deprecated, unsafe `sys_nerr`, `sys_errlist` global
variables with the function suggested by the CRT warning silenced via
`_CRT_SECURE_NO_WARNINGS`:
```
lib/curlx/strerr.c(291): warning C4996: '__sys_nerr': This function or variable may be unsafe. Consider using strerror instead.
lib/curlx/strerr.c(292): warning C4996: '__sys_errlist': This function or variable may be unsafe. Consider using strerror instead.
```
(where `strerror` in turn suggests `strerror_s`...)

Upside: returns an error and has a Unicode variant. Downaside: happy
to return success when passing unrecognized error codes. Work it around
by looking for the string "Unknown error" returned in such cases and
falling back to other methods to retrieve a description.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr
https://learn.microsoft.com/cpp/c-runtime-library/reference/strerror-s-strerror-s-wcserror-s-wcserror-s

Closes #19646
2025-11-24 14:29:44 +01:00
..
base64.c base64: make base64_encode() error on too long input 2025-10-30 15:41:28 +01:00
base64.h base64: make base64_encode() error on too long input 2025-10-30 15:41:28 +01:00
binmode.h lib: make CURLX_SET_BINMODE() and use it 2025-06-19 15:57:37 +02:00
curlx.h curlx: move Curl_strerror, use in src and tests, ban strerror globally 2025-10-06 09:44:23 +02:00
dynbuf.c dynbuf: assert on curlx_dyn_addf use with just "%s" 2025-08-06 08:32:07 +02:00
dynbuf.h curl_setup: use SIZE_MAX instead of SIZE_T_MAX 2025-08-29 09:45:06 +02:00
fopen.c curlx: replace mbstowcs/wcstombs with _s counterparts (Windows) 2025-11-21 16:45:42 +01:00
fopen.h curlx: add and use curlx_freopen() 2025-11-19 22:04:53 +01:00
inet_ntop.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
inet_ntop.h inet_pton, inet_ntop: drop declarations when unused 2025-07-28 01:51:55 +02:00
inet_pton.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
inet_pton.h inet_pton, inet_ntop: drop declarations when unused 2025-07-28 01:51:55 +02:00
multibyte.c build: avoid overriding system symbols for fopen functions 2025-09-30 01:10:36 +02:00
multibyte.h tidy-up: move CURL_UNCONST() out from macro curl_unicodefree() 2025-11-19 15:48:21 +01:00
nonblock.c tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
nonblock.h curlx: move nonblock.[ch] into curlx/ 2025-05-08 13:22:02 +02:00
strerr.c curlx/strerr: use strerror_s() on Windows 2025-11-24 14:29:44 +01:00
strerr.h curlx: move Curl_strerror, use in src and tests, ban strerror globally 2025-10-06 09:44:23 +02:00
strparse.c curl_setup: use SIZE_MAX instead of SIZE_T_MAX 2025-08-29 09:45:06 +02:00
strparse.h tidy-up: whitespace 2025-07-11 13:32:54 +02:00
timediff.c curlx: move into to curlx/ 2025-05-07 11:01:15 +02:00
timediff.h curlx: move into to curlx/ 2025-05-07 11:01:15 +02:00
timeval.c lib: rename curlx_timediff to curlx_timeleft_ms 2025-11-13 13:12:58 +01:00
timeval.h lib: rename curlx_timediff to curlx_timeleft_ms 2025-11-13 13:12:58 +01:00
version_win32.c build: drop Windows CE / CeGCC support 2025-11-15 15:35:23 +01:00
version_win32.h curlx: move version_win32.[ch] to curlx/ 2025-05-08 17:09:32 +02:00
wait.c tidy-up: prefer ifdef/ifndef for single checks 2025-07-27 22:35:17 +02:00
wait.h lib: make curlx_wait_ms() and use it 2025-06-19 15:57:37 +02:00
warnless.c multi: make max_total_* members size_t 2025-11-21 15:57:26 +01:00
warnless.h multi: make max_total_* members size_t 2025-11-21 15:57:26 +01:00
winapi.c curlx: replace mbstowcs/wcstombs with _s counterparts (Windows) 2025-11-21 16:45:42 +01:00
winapi.h windows: use native error code types more 2025-10-06 12:12:44 +02:00