badwords: prefer 'null-terminated'

Aligning with existing text.

Closes #20979
This commit is contained in:
Viktor Szakats 2026-03-18 11:29:53 +01:00
parent a3699e8b9e
commit 454db7aeee
No known key found for this signature in database
8 changed files with 13 additions and 11 deletions

View file

@ -149,7 +149,7 @@ CURLcode curlx_base64_decode(const char *src,
pos += 3 - padding;
}
/* Zero terminate */
/* Null-terminate */
*pos = '\0';
/* Return the decoded data */
@ -213,7 +213,7 @@ static CURLcode base64_encode(const char *table64,
}
}
/* Zero terminate */
/* Null-terminate */
*output = '\0';
/* Return the pointer to the new data (allocated memory) */

View file

@ -4187,7 +4187,7 @@ static CURLcode http_rw_hd(struct Curl_easy *data,
CURLcode result = CURLE_OK;
struct SingleRequest *k = &data->req;
int writetype;
DEBUGASSERT(!hd[hdlen]); /* null terminated */
DEBUGASSERT(!hd[hdlen]); /* null-terminated */
*pconsumed = 0;
if((0x0a == *hd) || (0x0d == *hd)) {
@ -4548,7 +4548,7 @@ CURLcode Curl_http_write_resp_hd(struct Curl_easy *data,
CURLcode result;
size_t consumed;
char tmp = 0;
DEBUGASSERT(!hd[hdlen]); /* null terminated */
DEBUGASSERT(!hd[hdlen]); /* null-terminated */
result = http_rw_hd(data, hd, hdlen, &tmp, 0, &consumed);
if(!result && is_eos) {

View file

@ -794,7 +794,7 @@ CURLcode Curl_xfer_write_resp_hd(struct Curl_easy *data,
const char *hd0, size_t hdlen, bool is_eos)
{
if(data->conn->scheme->run->write_resp_hd) {
DEBUGASSERT(!hd0[hdlen]); /* null terminated */
DEBUGASSERT(!hd0[hdlen]); /* null-terminated */
/* protocol handlers offering this function take full responsibility
* for writing all received download data to the client. */
return data->conn->scheme->run->write_resp_hd(data, hd0, hdlen, is_eos);

View file

@ -517,7 +517,7 @@ static CURLcode mbed_load_cacert(struct Curl_cfilter *cf,
curlx_free(newblob);
}
#else
/* DER encoded certs do not need to be null terminated because it is a
/* DER encoded certs do not need to be null-terminated because it is a
binary format. Thus, if we are not compiling with PEM_PARSE we can avoid
the extra memory copies altogether. */
ret = mbedtls_x509_crt_parse_der(&backend->cacert, ca_info_blob->data,
@ -630,7 +630,7 @@ static CURLcode mbed_load_clicert(struct Curl_cfilter *cf,
curlx_free(newblob);
}
#else
/* DER encoded certs do not need to be null terminated because it is a
/* DER encoded certs do not need to be null-terminated because it is a
binary format. Thus, if we are not compiling with PEM_PARSE we can avoid
the extra memory copies altogether. */
ret = mbedtls_x509_crt_parse_der(&backend->clicert, ssl_cert_blob->data,