mirror of
https://github.com/curl/curl.git
synced 2026-08-25 23:03:39 +03:00
checksrc: reduce directory-specific exceptions
By making them defaults, then fixing and/or reshuffling remaining exceptions as necessary. - checksrc: ban by default: `snprintf`, `vsnprintf`, `sscanf`, `strtol`. - examples: replace `strtol` with `atoi` to avoid a checksrc exception. - tests/libtest: replace `strtol` with `atol`. - tests/server: replace most `strtol` with `atol`. - tests/server: replace most `strtoul` with `atol`/`atoi`. - tests/server: drop no longer used `util_ultous`. - fix typo in checksrc rules: `vsnprint` -> `vsnprintf`. - update local exceptions. Also: - examples: ban curl printf functions. They're discouraged in user code. - examples: replace curl printf with system printf. Add `snprintf` workaround for <VS2015. - examples/synctime: fix `-Wfloat-equal`. - examples/synctime: exclude for non-Windows and non-UWP Windows. - examples/synctime: build by default. Closes #18823
This commit is contained in:
parent
fff36a360e
commit
45438c8d6f
36 changed files with 124 additions and 142 deletions
|
|
@ -33,6 +33,10 @@
|
|||
#include <curl/curl.h>
|
||||
#include <curl/mprintf.h>
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1900)
|
||||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
#ifndef CURLPIPE_MULTIPLEX
|
||||
#error "too old libcurl, cannot do HTTP/2 server push!"
|
||||
#endif
|
||||
|
|
@ -173,7 +177,7 @@ static int server_push_callback(CURL *parent,
|
|||
|
||||
(void)parent;
|
||||
|
||||
curl_msnprintf(filename, 128, "push%u", count++);
|
||||
snprintf(filename, sizeof(filename), "push%u", count++);
|
||||
|
||||
/* here's a new stream, save it in a new file for each new push */
|
||||
out = fopen(filename, "wb");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue