mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
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
This commit is contained in:
parent
eaf66f18b7
commit
34ad78da89
53 changed files with 751 additions and 570 deletions
|
|
@ -24,11 +24,6 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
#include "urldata.h"
|
||||
|
||||
#define STRERROR_LEN 256 /* a suitable length */
|
||||
|
||||
const char *Curl_strerror(int err, char *buf, size_t buflen);
|
||||
#ifdef USE_WINDOWS_SSPI
|
||||
const char *Curl_sspi_strerror(int err, char *buf, size_t buflen);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue