misc: null-terminate

Make use of this term consistently.

Closes #9527
This commit is contained in:
Daniel Stenberg 2022-09-17 17:32:21 +02:00
parent db02e0e980
commit 307b7543ea
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
19 changed files with 26 additions and 26 deletions

View file

@ -138,7 +138,7 @@ CURLcode Curl_base64_decode(const char *src,
/* Calculate the size of the decoded string */
rawlen = (numQuantums * 3) - padding;
/* Allocate our buffer including room for a zero terminator */
/* Allocate our buffer including room for a null-terminator */
newstr = malloc(rawlen + 1);
if(!newstr)
return CURLE_OUT_OF_MEMORY;

View file

@ -279,7 +279,7 @@ Curl_he2ai(const struct hostent *he, int port)
for(i = 0; (curr = he->h_addr_list[i]) != NULL; i++) {
size_t ss_size;
size_t namelen = strlen(he->h_name) + 1; /* include zero termination */
size_t namelen = strlen(he->h_name) + 1; /* include null-terminatior */
#ifdef ENABLE_IPV6
if(he->h_addrtype == AF_INET6)
ss_size = sizeof(struct sockaddr_in6);

View file

@ -792,7 +792,7 @@ doh2ai(const struct dohentry *de, const char *hostname, int port)
#endif
CURLcode result = CURLE_OK;
int i;
size_t hostlen = strlen(hostname) + 1; /* include zero terminator */
size_t hostlen = strlen(hostname) + 1; /* include null-terminator */
if(!de)
/* no input == no output! */

View file

@ -46,7 +46,7 @@
struct dynbuf {
char *bufr; /* point to a null-terminated allocated buffer */
size_t leng; /* number of bytes *EXCLUDING* the zero terminator */
size_t leng; /* number of bytes *EXCLUDING* the null-terminator */
size_t allc; /* size of the current allocation */
size_t toobig; /* size limit for the buffer */
#ifdef DEBUGBUILD

View file

@ -259,7 +259,7 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value,
/* put the data at the end of the previous data, not the newline */
memcpy(&newhs->value[olen], value, vlen);
newhs->value[olen + vlen] = 0; /* zero terminate at newline */
newhs->value[olen + vlen] = 0; /* null-terminate at newline */
/* insert this node into the list of headers */
Curl_llist_insert_next(&data->state.httphdrs, data->state.httphdrs.tail,

View file

@ -956,7 +956,7 @@ static int dprintf_formatf(
else
*fptr++ = 'f';
*fptr = 0; /* and a final zero termination */
*fptr = 0; /* and a final null-termination */
#ifdef __clang__
#pragma clang diagnostic push

View file

@ -212,7 +212,7 @@ CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num)
/*
* Curl_rand_hex() fills the 'rnd' buffer with a given 'num' size with random
* hexadecimal digits PLUS a zero terminating byte. It must be an odd number
* hexadecimal digits PLUS a null-terminating byte. It must be an odd number
* size.
*/
@ -235,7 +235,7 @@ CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,
/* make sure it fits in the local buffer and that it is an odd number! */
return CURLE_BAD_FUNCTION_ARGUMENT;
num--; /* save one for zero termination */
num--; /* save one for null-termination */
result = Curl_rand(data, buffer, num/2);
if(result)

View file

@ -42,7 +42,7 @@ CURLcode Curl_rand(struct Curl_easy *data, unsigned char *rnd, size_t num);
/*
* Curl_rand_hex() fills the 'rnd' buffer with a given 'num' size with random
* hexadecimal digits PLUS a zero terminating byte. It must be an odd number
* hexadecimal digits PLUS a null-terminating byte. It must be an odd number
* size.
*/
CURLcode Curl_rand_hex(struct Curl_easy *data, unsigned char *rnd,

View file

@ -382,7 +382,7 @@ CURLcode Curl_auth_create_digest_md5_message(struct Curl_easy *data,
if(!(qop_values & DIGEST_QOP_VALUE_AUTH))
return CURLE_BAD_CONTENT_ENCODING;
/* Generate 32 random hex chars, 32 bytes + 1 zero termination */
/* Generate 32 random hex chars, 32 bytes + 1 null-termination */
result = Curl_rand_hex(data, (unsigned char *)cnonce, sizeof(cnonce));
if(result)
return result;

View file

@ -658,7 +658,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
/* LanManager response */
/* NT response */
0, /* zero termination */
0, /* null-termination */
0, 0, 0, /* type-3 long, the 24 upper bits */
SHORTPAIR(0x18), /* LanManager response length, twice */