tidy-up: comments, messages, formatting

- 'null-terminate', sync casing.
- add an `#endif` comment.
- avoid a few instances of 'will'.
- configure: 'aws' -> 'aws-sigv4', where missing.
- unfold/fold lines.
- update memzero/strzero comments.
- uppercase 'CRLF'.

Closes #22443
This commit is contained in:
Viktor Szakats 2026-07-24 02:44:11 +02:00
parent 83216878e4
commit c4013cdb85
No known key found for this signature in database
22 changed files with 49 additions and 46 deletions

View file

@ -147,8 +147,12 @@ CURLcode Curl_ed25519_sign(const unsigned char *key, size_t keylen,
const unsigned char *msg, size_t msglen,
unsigned char *sig, size_t *siglen)
{
(void)key; (void)keylen; (void)msg; (void)msglen;
(void)sig; (void)siglen;
(void)key;
(void)keylen;
(void)msg;
(void)msglen;
(void)sig;
(void)siglen;
return CURLE_NOT_BUILT_IN;
}
@ -160,8 +164,12 @@ CURLcode Curl_ed25519_sign(const unsigned char *key, size_t keylen,
const unsigned char *msg, size_t msglen,
unsigned char *sig, size_t *siglen)
{
(void)key; (void)keylen; (void)msg; (void)msglen;
(void)sig; (void)siglen;
(void)key;
(void)keylen;
(void)msg;
(void)msglen;
(void)sig;
(void)siglen;
return CURLE_NOT_BUILT_IN;
}

View file

@ -437,10 +437,9 @@ static OM_uint32 stub_gss_indicate_mechs(
#ifdef HAVE_GSS_SET_NEG_MECHS /* MIT Kerberos 1.8+ (2010-03-02),
missing from Apple GSS, GNU GSS */
static OM_uint32 stub_gss_set_neg_mechs(
OM_uint32 *min,
gss_cred_id_t cred_handle,
const gss_OID_set mech_set)
static OM_uint32 stub_gss_set_neg_mechs(OM_uint32 *min,
gss_cred_id_t cred_handle,
const gss_OID_set mech_set)
{
struct stub_gss_cred_id_t_desc *cred;
size_t i;

View file

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

View file

@ -108,14 +108,14 @@ void curlx_memzero_low(void *buf, size_t size)
}
#endif
/* Free 'buf' after zeroing its content. */
/* Fill 'buf' with zeroes. */
void curlx_memzero(void *buf, size_t size)
{
if(buf)
curlx_memzero_low(buf, size);
}
/* Free 'buf' after zeroing its content, where 'buf' is null-terminated. */
/* Fill 'buf' with zeroes, where 'buf' is null-terminated. */
void curlx_strzero(void *buf)
{
if(buf)

View file

@ -196,7 +196,7 @@ void curl_free(void *p)
* Curl_hexencode()
*
* Converts binary input to lowercase hex-encoded ASCII output.
* Null-terminated.
* null-terminated.
*/
void Curl_hexencode(const unsigned char *src, size_t len, /* input length */
unsigned char *out, size_t olen) /* output buffer size */

View file

@ -3794,7 +3794,7 @@ static CURLcode ftp_done_check_partial(struct Curl_easy *data,
(data->state.infilesize != -1) && /* upload with known size */
((!data->set.crlf && !data->state.prefer_ascii && /* no conversion */
(data->state.infilesize != data->req.writebytecount)) ||
((data->set.crlf || data->state.prefer_ascii) && /* maybe crlf conv */
((data->set.crlf || data->state.prefer_ascii) && /* maybe CRLF conv */
(data->state.infilesize > data->req.writebytecount))
)) {
failf(data, "Uploaded unaligned file size (%" FMT_OFF_T

View file

@ -1407,7 +1407,7 @@ static const struct SASLproto saslpop3 = {
pop3_continue_auth, /* Send authentication continuation */
pop3_cancel_auth, /* Send authentication cancellation */
pop3_get_message, /* Get SASL response message */
255 - 8, /* Max line len - strlen("AUTH ") - 1 space - crlf */
255 - 8, /* Max line len - strlen("AUTH ") - 1 space - CRLF */
'*', /* Code received when continuation is expected */
'+', /* Code to receive upon authentication success */
SASL_AUTH_DEFAULT, /* Default mechanisms */

View file

@ -1128,7 +1128,7 @@ static CURLcode do_init_reader_stack(struct Curl_easy *data,
data->req.reader.stack = r;
clen = r->crt->total_length(data, r);
/* if we do not have 0 length init, and crlf conversion is wanted,
/* if we do not have 0 length init, and CRLF conversion is wanted,
* add the reader for it */
if(clen && (data->set.crlf
#ifdef CURL_PREFER_LF_LINEENDS

View file

@ -1657,7 +1657,7 @@ static const struct SASLproto saslsmtp = {
smtp_continue_auth, /* Send authentication continuation */
smtp_cancel_auth, /* Cancel authentication */
smtp_get_message, /* Get SASL response message */
512 - 8, /* Max line len - strlen("AUTH ") - 1 space - crlf */
512 - 8, /* Max line len - strlen("AUTH ") - 1 space - CRLF */
334, /* Code received when continuation is expected */
235, /* Code to receive upon authentication success */
SASL_AUTH_DEFAULT, /* Default mechanisms */

View file

@ -341,7 +341,7 @@ CURLcode Curl_auth_decode_ntlm_type2_message(struct Curl_easy *data,
/* NTLM type-2 message structure:
Index Description Content
0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP"
0 NTLMSSP Signature null-terminated ASCII "NTLMSSP"
(0x4e544c4d53535000)
8 NTLM Message Type long (0x02000000)
12 Target Name security buffer
@ -430,7 +430,7 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data,
/* NTLM type-1 message structure:
Index Description Content
0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP"
0 NTLMSSP Signature null-terminated ASCII "NTLMSSP"
(0x4e544c4d53535000)
8 NTLM Message Type long (0x01000000)
12 Flags long
@ -549,13 +549,13 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
/* NTLM type-3 message structure:
Index Description Content
0 NTLMSSP Signature Null-terminated ASCII "NTLMSSP"
0 NTLMSSP Signature null-terminated ASCII "NTLMSSP"
(0x4e544c4d53535000)
8 NTLM Message Type long (0x03000000)
12 LM/LMv2 Response security buffer
20 NTLM/NTLMv2 Response security buffer
28 Target Name security buffer
36 username security buffer
36 Username security buffer
44 Workstation Name security buffer
(52) Session Key security buffer (*)
(60) Flags long (*)