mirror of
https://github.com/curl/curl.git
synced 2026-07-25 18:37:17 +03:00
tidy-up: miscellaneous
- badwords: replace stray synonyms with 'null-terminator'. - tests/FILEFORMAT.md: tidy up feature descriptions. - printf: replace stray `%i` masks with `%d` for consistency. - pytest: add comments for empty excepts to try silencing GitHub CodeQL warnings. - tool1394, unit1675: merge nested `if`s. - dnscache: fix typo in comment. - fix whitespace, indent and newlines. Closes #21921
This commit is contained in:
parent
849317ff5c
commit
952b04474c
31 changed files with 90 additions and 90 deletions
|
|
@ -156,14 +156,14 @@ Maybe use of `realloc()` should rather use the dynbuf functions?
|
|||
|
||||
Do not allow new code that grows buffers without using dynbuf.
|
||||
|
||||
Use of C functions that rely on a terminating zero must only be used on data
|
||||
that really do have a null-terminating zero.
|
||||
Use of C functions that rely on a null-terminator must only be used on data
|
||||
that really do have a null-terminator (`\0` byte).
|
||||
|
||||
## Dangerous "data styles"
|
||||
|
||||
Make extra precautions and verify that memory buffers that need a terminating
|
||||
zero always have exactly that. Buffers *without* a null-terminator must not be
|
||||
used as input to string functions.
|
||||
Make extra precautions and verify that memory buffers that need
|
||||
null-terminator always have exactly that. Buffers *without* a null-terminator
|
||||
must not be used as input to string functions.
|
||||
|
||||
# Commit messages
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ static void timer_cb(EV_P_ struct ev_timer *w, int revents)
|
|||
CURLMcode mresult;
|
||||
struct GlobalInfo *g;
|
||||
|
||||
printf("%s w %p revents %i\n", __PRETTY_FUNCTION__, (void *)w, revents);
|
||||
printf("%s w %p revents %d\n", __PRETTY_FUNCTION__, (void *)w, revents);
|
||||
|
||||
g = (struct GlobalInfo *)w->data;
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ static void event_cb(EV_P_ struct ev_io *w, int revents)
|
|||
int action = ((revents & EV_READ) ? CURL_POLL_IN : 0) |
|
||||
((revents & EV_WRITE) ? CURL_POLL_OUT : 0);
|
||||
|
||||
printf("%s w %p revents %i\n", __PRETTY_FUNCTION__, (void *)w, revents);
|
||||
printf("%s w %p revents %d\n", __PRETTY_FUNCTION__, (void *)w, revents);
|
||||
g = (struct GlobalInfo *)w->data;
|
||||
|
||||
mresult = curl_multi_socket_action(g->multi, w->fd, action,
|
||||
|
|
@ -269,7 +269,7 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
|
|||
struct SockInfo *fdp = (struct SockInfo *)sockp;
|
||||
const char *whatstr[] = { "none", "IN", "OUT", "INOUT", "REMOVE" };
|
||||
|
||||
printf("%s e %p s %i what %i cbp %p sockp %p\n",
|
||||
printf("%s e %p s %d what %d cbp %p sockp %p\n",
|
||||
__PRETTY_FUNCTION__, e, s, what, cbp, sockp);
|
||||
|
||||
fprintf(MSG_OUT, "socket callback: s=%d e=%p what=%s ", s, e, whatstr[what]);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ SPDX-License-Identifier: curl
|
|||
This is the internal module for creating and handling "dynamic buffers". This
|
||||
means buffers that can be appended to, dynamically and grow to adapt.
|
||||
|
||||
There is always a terminating zero put at the end of the dynamic buffer.
|
||||
There is always a null-terminator put at the end of the dynamic buffer.
|
||||
|
||||
The `struct dynbuf` is used to hold data for each instance of a dynamic
|
||||
buffer. The members of that struct **MUST NOT** be accessed or modified
|
||||
|
|
@ -120,8 +120,8 @@ trusted or used anymore after the next buffer manipulation call.
|
|||
size_t curlx_dyn_len(const struct dynbuf *s);
|
||||
```
|
||||
|
||||
Returns the length of the buffer in bytes. Does not include the terminating
|
||||
zero byte.
|
||||
Returns the length of the buffer in bytes. Does not include the
|
||||
null-terminator byte.
|
||||
|
||||
## `curlx_dyn_setlen`
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ write output to stdout, the standard output stream; **curl_mfprintf()** and
|
|||
**curl_mvsnprintf()** write to the character string **buffer**.
|
||||
|
||||
The functions **curl_msnprintf()** and **curl_mvsnprintf()** write at most
|
||||
*maxlength* bytes (including the terminating null byte ('0')) to
|
||||
*maxlength* bytes (including the null-terminator byte ('0')) to
|
||||
*buffer*.
|
||||
|
||||
The functions **curl_mvprintf()**, **curl_mvfprintf()**,
|
||||
|
|
@ -246,10 +246,10 @@ is written.
|
|||
|
||||
The *const char ** argument is expected to be a pointer to an array of
|
||||
character type (pointer to a string). Characters from the array are written up
|
||||
to (but not including) a terminating null byte. If a precision is specified,
|
||||
to (but not including) a null-terminator byte. If a precision is specified,
|
||||
no more than the number specified are written. If a precision is given, no
|
||||
null byte need be present; if the precision is not specified, or is greater
|
||||
than the size of the array, the array must contain a terminating null byte.
|
||||
than the size of the array, the array must contain a null-terminator byte.
|
||||
|
||||
## p
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,6 @@ curl_easy_setopt(3) returns a CURLcode indicating success or error.
|
|||
CURLE_OK (0) means everything was OK, non-zero means an error occurred, see
|
||||
libcurl-errors(3).
|
||||
|
||||
Note that curl_easy_setopt(3) does immediately parse the given string so when
|
||||
given a bad DoH URL, libcurl might not detect the problem until it later tries
|
||||
to resolve a name with it.
|
||||
Note that curl_easy_setopt(3) does not immediately parse the given string so
|
||||
when given a bad DoH URL, libcurl might not detect the problem until it later
|
||||
tries to resolve a name with it.
|
||||
|
|
|
|||
|
|
@ -487,7 +487,7 @@ Features testable here are:
|
|||
- `brotli`
|
||||
- `c-ares` - c-ares is used for (all) name resolves
|
||||
- `CharConv`
|
||||
- `codeset-utf8`. If the running codeset is UTF-8 capable.
|
||||
- `codeset-utf8` - if the running codeset is UTF-8 capable.
|
||||
- `cookies`
|
||||
- `crypto`
|
||||
- `cygwin`
|
||||
|
|
@ -509,13 +509,13 @@ Features testable here are:
|
|||
- `IPv6`
|
||||
- `Kerberos`
|
||||
- `Largefile`
|
||||
- `large-time` (time_t is larger than 32-bit)
|
||||
- `large-size` (size_t is larger than 32-bit)
|
||||
- `large-time` - time_t is larger than 32-bit
|
||||
- `large-size` - size_t is larger than 32-bit
|
||||
- `libssh2`
|
||||
- `libssh`
|
||||
- `badlibssh` (libssh configuration incompatible with the test suite)
|
||||
- `badlibssh` - libssh configuration incompatible with the test suite
|
||||
- `libz`
|
||||
- `local-http`. The HTTP server runs on 127.0.0.1
|
||||
- `local-http` - the HTTP server runs on 127.0.0.1
|
||||
- `manual`
|
||||
- `mbedtls`
|
||||
- `Mime`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue