curl/lib/curlx
Viktor Szakats 34ad78da89
curlx: move Curl_strerror, use in src and tests, ban strerror globally
Also:
- tests/server: replace local `sstrerror()` with `curlx_strerror()`.
- tests/server: show the error code next to the string, where missing.
- curlx: use `curl_msnprintf()` when building for src and tests.
  (units was already using it.)
- lib: drop unused includes found along the way.
- curlx_strerror(): avoid compiler warning (and another similar one):
  ```
  In file included from servers.c:14:
  ../../lib/../../lib/curlx/strerr.c: In function ‘curlx_strerror’:
  ../../lib/../../lib/curlx/strerr.c:328:32: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
    328 |       SNPRINTF(buf, buflen, "%s", msg);
        |                                ^
  ../../lib/../../lib/curlx/strerr.c:47:18: note: ‘snprintf’ output 1 or more bytes (assuming 2) into a destination of size 1
     47 | #define SNPRINTF snprintf
        |                  ^
  ../../lib/../../lib/curlx/strerr.c:328:7: note: in expansion of macro ‘SNPRINTF’
    328 |       SNPRINTF(buf, buflen, "%s", msg);
        |       ^~~~~~~~
  ```

Follow-up to 45438c8d6f #18823

Closes #18840
2025-10-06 09:44:23 +02:00
..
.checksrc curlx: move Curl_strerror, use in src and tests, ban strerror globally 2025-10-06 09:44:23 +02:00
base64.c base64: accept zero length argument to base64_encode 2025-09-19 22:57:20 +02:00
base64.h mime: reuse the base64 string from the base64 code 2025-05-10 23:01:14 +02: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 build: avoid overriding system symbols for fopen functions 2025-09-30 01:10:36 +02:00
fopen.h tidy-up: fcntl.h includes 2025-09-30 21:57:17 +02:00
inet_ntop.c lib: remove personal names from comments 2025-10-02 14:22:57 +02:00
inet_ntop.h inet_pton, inet_ntop: drop declarations when unused 2025-07-28 01:51:55 +02:00
inet_pton.c curlx: move curlx_inet_pton 2025-05-09 13:45:24 +02: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: more whitespace/indent, comments 2025-07-25 11:47:51 +02: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: move Curl_strerror, use in src and tests, ban strerror globally 2025-10-06 09:44:23 +02: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 tidy-up: move literal to the right side of comparisons 2025-07-27 22:35:17 +02:00
timeval.h curlx: move into to curlx/ 2025-05-07 11:01:15 +02:00
version_win32.c tidy-up: miscellaneous 2025-09-27 12:59:07 +02: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 curl_setup: use SIZE_MAX instead of SIZE_T_MAX 2025-08-29 09:45:06 +02:00
warnless.h warnless: drop parts of the read/write preprocessor hack (Windows) 2025-06-19 17:09:43 +02:00
winapi.c curlx: move Curl_strerror, use in src and tests, ban strerror globally 2025-10-06 09:44:23 +02:00
winapi.h curlx: add curlx_winapi_ functions 2025-05-09 10:45:36 +02:00