]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tidy-up: comments, messages, formatting
authorViktor Szakats <commit@vsz.me>
Fri, 24 Jul 2026 00:44:11 +0000 (02:44 +0200)
committerViktor Szakats <commit@vsz.me>
Thu, 30 Jul 2026 09:26:22 +0000 (11:26 +0200)
- '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

22 files changed:
README
configure.ac
docs/libcurl/opts/CURLOPT_HTTPSIG_ALGORITHM.md
docs/libcurl/opts/CURLOPT_HTTPSIG_HEADERS.md
docs/libcurl/opts/CURLOPT_HTTPSIG_KEY.md
docs/libcurl/opts/CURLOPT_HTTPSIG_KEYID.md
lib/curl_ed25519.c
lib/curl_gssapi.c
lib/curlx/base64.c
lib/curlx/strdup.c
lib/escape.c
lib/ftp.c
lib/pop3.c
lib/sendf.c
lib/smtp.c
lib/vauth/ntlm.c
projects/OS400/os400sys.c
projects/vms/curl_crtl_init.c
src/tool_doswin.c
tests/ftpserver.pl
tests/negtelnetserver.py
tests/server/tftpd.c

diff --git a/README b/README
index 4ee7e43a2c84ddeaccb0ec36696977bfdbb83f8d..bc04a79dbc5e82b67abf0d1c46b5d139063cfa37 100644 (file)
--- a/README
+++ b/README
@@ -41,7 +41,7 @@ GIT
 
   git clone https://github.com/curl/curl
 
-  (you will get a directory named curl created, filled with the source code)
+  (you get a directory named curl, filled with the source code)
 
 SECURITY PROBLEMS
 
index 434534d2fb1bd725c7a6f5b64c4c8f3f3e06702b..5e9f1ac2e47ddbb7e58a970e4030aacbee6591d4 100644 (file)
@@ -2153,7 +2153,7 @@ fi
 
 case "x$SSL_DISABLED$OPENSSL_ENABLED$GNUTLS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$SCHANNEL_ENABLED$RUSTLS_ENABLED" in
   x)
-    AC_MSG_ERROR([TLS not detected, you will not be able to use HTTPS, FTPS, NTLM and more.
+    AC_MSG_ERROR([TLS not detected, cannot build with HTTPS, FTPS, NTLM and more.
 Use --with-openssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-schannel, --with-amissl or --with-rustls to address this.])
     ;;
   x1)
@@ -4571,16 +4571,16 @@ AS_HELP_STRING([--disable-negotiate-auth],[Disable negotiate authentication]),
 )
 
 dnl ************************************************************
-dnl disable aws
+dnl disable aws-sigv4
 dnl
-AC_MSG_CHECKING([whether to enable aws sig methods])
+AC_MSG_CHECKING([whether to enable aws-sigv4 methods])
 AC_ARG_ENABLE(aws,
-AS_HELP_STRING([--enable-aws],[Enable AWS sig support (default)])
-AS_HELP_STRING([--disable-aws],[Disable AWS sig support]),
+AS_HELP_STRING([--enable-aws],[Enable aws-sigv4 support (default)])
+AS_HELP_STRING([--disable-aws],[Disable aws-sigv4 support]),
 [ case "$enableval" in
   no)
     AC_MSG_RESULT(no)
-    AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable AWS sig support])
+    AC_DEFINE(CURL_DISABLE_AWS, 1, [to disable aws-sigv4 support])
     ;;
   *)
     AC_MSG_RESULT(yes)
index 2501ec33eb0167b0bbfb32fb5dc473779f7448fd..3fa4da378bd078f45ee5ec1ce69a4a25e740d9fb 100644 (file)
@@ -68,8 +68,7 @@ int main(void)
 
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/api");
-    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM,
-                     CURLHTTPSIG_ED25519);
+    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);
     curl_easy_setopt(curl, CURLOPT_HTTPSIG_KEY,
                      "9f8362f87a484a954e6e740c5b4c0e84"
                      "229139a20aa8ab56ff66586f6a7d29c5");
index 2e2cc4f77ea449799d40fedde3ec7c5703a08e5d..ef56d2f9bb65f3f8c335797da45b54791b30c471 100644 (file)
@@ -84,8 +84,7 @@ int main(void)
     headers = curl_slist_append(headers, "User-Agent: MyApp/1.0");
     curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/api");
-    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM,
-                     CURLHTTPSIG_ED25519);
+    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);
     curl_easy_setopt(curl, CURLOPT_HTTPSIG_KEY,
                      "9f8362f87a484a954e6e740c5b4c0e84"
                      "229139a20aa8ab56ff66586f6a7d29c5");
index e81378f9cc88b61b530b280d3d37a9f65cc3a4ae..1f03de2c26e55378c830770aef13a95f4a91878d 100644 (file)
@@ -69,8 +69,7 @@ int main(void)
 
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/api");
-    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM,
-                     CURLHTTPSIG_ED25519);
+    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);
     curl_easy_setopt(curl, CURLOPT_HTTPSIG_KEY,
                      "9f8362f87a484a954e6e740c5b4c0e84"
                      "229139a20aa8ab56ff66586f6a7d29c5");
index d921db89a4bab3bd7dfafa89aefba4f47c547bd0..43e0c087ea232c700ae310a32ec1cc1712b7c449 100644 (file)
@@ -55,8 +55,7 @@ int main(void)
 
   if(curl) {
     curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/api");
-    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM,
-                     CURLHTTPSIG_ED25519);
+    curl_easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);
     curl_easy_setopt(curl, CURLOPT_HTTPSIG_KEY,
                      "9f8362f87a484a954e6e740c5b4c0e84"
                      "229139a20aa8ab56ff66586f6a7d29c5");
index 318c70ed2110cbb71e34c295f27dc0cf3f49c048..5c664d95c6dad4b6fbb81c668508ddee2a89a52b 100644 (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;
 }
 
index 354fa00deab01347f40f70c08802ea27deff35d1..437f76d04a46d7f63aff4376dc610ee9e95ce907 100644 (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;
index 7f51576f5098051d3943c8970371054aa80f736d..519b045cfe309c4c75e157f14403a689a8a867c1 100644 (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) */
index 6c967ff296f0aaa6d0f05e7cb14e1e9e5caa542c..ebc58c23634b53e75a46f6ca5068d7b6c97d7fb0 100644 (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)
index 4aff583de1b2ee9bd1581222d24d6f652896bd2b..a1a714f8f59230254d3f581690a0a7ed6d2adb59 100644 (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 */
index abcc9d25a967a7d2602ed28bfa4a5be4dee9cd26..811e58508b0a437487c4b102e3d6b69dcab92017 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -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
index 071872687cd876a6216f0a80d7409f67052f1c56..9ebe7ce4bffdd791340bd1f4cdedd2b057eea0d5 100644 (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 */
index a5aad668f5e0fc3928133fbf5b02c075538c7d63..78cda23cfec65013432f3efca043d0656f9a8310 100644 (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
index a37a5733811e10882e6225eb372ee3aea465f059..616fa8c00f052291083290a9375bf11b4e3d22ae 100644 (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 */
index 0be26b3cac273bc7494c364c6147db04afcb8cba..3f1ffb50ce7a1ccba5dc0aacaf0f62719022cb26 100644 (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 (*)
index 207eb297bb79b0471ae9ea02479fdf486a06ade2..41f0f670e70b6be7afd9dca415c1d32121ecf487 100644 (file)
@@ -1035,4 +1035,4 @@ int Curl_os400_inflateEnd(z_streamp strm)
   return ret;
 }
 
-#endif
+#endif /* HAVE_LIBZ */
index 9c8e46761ef9958b93740a29867924e3fbb99459..09c46dd03c38a2ec7546cbc73b02e320f6f40d08 100644 (file)
@@ -126,7 +126,7 @@ static int sys_trnlnm(const char *logname, char *value, int value_len)
 
   if($VMS_STATUS_SUCCESS(status)) {
 
-    /* Null-terminate and return the string */
+    /* null-terminate and return the string */
     /*--------------------------------------*/
     value[result] = '\0';
   }
index 52eb69bd695ed10af8825529495e71742806ef90..aacab5f75d1db46506b158a557eac4b25f928b47 100644 (file)
@@ -710,8 +710,8 @@ struct win_thread_data {
   /* This is the listen socket for the thread. It is closed after the first
      connection. */
   curl_socket_t socket_l;
-  /* This is the random number which the background thread will use to verify
-   * the peer. */
+  /* This is the random number which the background thread uses to verify
+     the peer. */
   uint64_t expected_auth_val;
 };
 
index 958160646f29f332d388c8d9a24323f3fdad019a..23278e6de665580ce019a4033a2f7cff4d585a78 100755 (executable)
@@ -2574,8 +2574,8 @@ sub PASV_ftp {
         sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\r\n", $pasvport);
     }
 
-    logmsg "Client has been notified that DATA conn ".
-           "will be accepted on port $pasvport\n";
+    logmsg "Client has been notified that upcoming DATA connection ".
+           "is awaited on port $pasvport\n";
 
     if($nodataconn) {
         my $str = nodataconn_str();
@@ -2765,7 +2765,7 @@ sub datasockf_state {
     }
     elsif($state eq 'PASSIVE_NODATACONN') {
         # Data sockfilter bound port without listening,
-        # client will not be able to establish data connection.
+        # client is unable to establish data connection.
         $datasockf_state = $state;
         $datasockf_mode = 'passive';
         $datasockf_runs = 'yes';
index 8d074f5046e609e7b4ee0557e93a0287dc83271c..44ae2eeb75c8bdbd45dc2d7fbddef9a1c9586467 100755 (executable)
@@ -126,7 +126,7 @@ class Negotiator:
         """
         buffer = bytearray()
 
-        # If we keep receiving negotiation sequences, we will not fill the buffer.
+        # If we keep receiving negotiation sequences, we do not fill the buffer.
         # Keep looping while we can, and until we have something to give back
         # to the caller.
         while len(buffer) == 0:
index 8f2ab642cdff17309c49f7faa69ccac2b61da183..8144f81be887d875f7867d07316aca79211afeee 100644 (file)
@@ -186,7 +186,7 @@ static struct bf bfs[2];
 static int nextone;     /* index of next buffer to use */
 static int current;     /* index of buffer in use */
 
-                           /* control flags for crlf conversions */
+                           /* control flags for CRLF conversions */
 static int newline = 0;    /* fillbuf: in middle of newline expansion */
 static int prevchar = -1;  /* putbuf: previous char (cr check) */
 
@@ -296,7 +296,7 @@ static void nak(int error)
  */
 static struct tftphdr *rw_init(int x)
 {
-  newline = 0;                    /* init crlf flag */
+  newline = 0;                    /* init CRLF flag */
   prevchar = -1;
   bfs[0].counter = BF_ALLOC;      /* pass out the first buffer */
   current = 0;