From: Daniel Stenberg Date: Fri, 30 May 2025 09:20:05 +0000 (+0200) Subject: spelling: call it null-terminate consistently X-Git-Tag: curl-8_14_1~31 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=fe81a80ae72caedd1403769fc4c350e2f1afec43;p=thirdparty%2Fcurl.git spelling: call it null-terminate consistently With a dash, using two Ls. Also for different forms of the word. Use NULL in all uppercase if it means a zero pointer. Follow-up to 307b7543ea1e73ab04e062bdbe4b Closes #17489 --- diff --git a/docs/internals/STRPARSE.md b/docs/internals/STRPARSE.md index 2a16719190..7d1a3a402f 100644 --- a/docs/internals/STRPARSE.md +++ b/docs/internals/STRPARSE.md @@ -18,7 +18,7 @@ if(curlx_str_word(&line, &word1, MAX) || fprintf(stderr, "ERROR\n"); ~~~ -The input pointer **must** point to a null terminated buffer area or these +The input pointer **must** point to a null-terminated buffer area or these functions risk continuing "off the edge". ## Strings diff --git a/docs/libcurl/curl_easy_ssls_export.md b/docs/libcurl/curl_easy_ssls_export.md index be49a05ffe..2d132646f8 100644 --- a/docs/libcurl/curl_easy_ssls_export.md +++ b/docs/libcurl/curl_easy_ssls_export.md @@ -68,10 +68,10 @@ username/password are not exported. ## Session Key -This is a printable, 0-terminated string that starts with **hostname:port** -the session ticket is originating from and also contains all relevant -SSL parameters used in the connection. The key also carries the name -and version number of the TLS backend used. +This is a printable, null-terminated string that starts with **hostname:port** +the session ticket is originating from and also contains all relevant SSL +parameters used in the connection. The key also carries the name and version +number of the TLS backend used. It is recommended to only persist **session_key** when it can be protected from outside access. Since the hostname appears in plain text, it would diff --git a/docs/libcurl/curl_formadd.md b/docs/libcurl/curl_formadd.md index 90bced8a0d..6bef05523a 100644 --- a/docs/libcurl/curl_formadd.md +++ b/docs/libcurl/curl_formadd.md @@ -79,7 +79,7 @@ contain zero-valued bytes. followed by a pointer to the contents of this part, the actual data to send away. libcurl copies the provided data, so your application does not need to -keep it around after this function call. If the data is not null terminated, +keep it around after this function call. If the data is not null-terminated, or if you would like it to contain zero bytes, you must set the length of the name with **CURLFORM_CONTENTSLENGTH**. The copied data is freed by curl_formfree(3). diff --git a/docs/libcurl/curl_url_get.md b/docs/libcurl/curl_url_get.md index d82b1b24c4..a9bb0bdc23 100644 --- a/docs/libcurl/curl_url_get.md +++ b/docs/libcurl/curl_url_get.md @@ -71,7 +71,7 @@ does not decode the scheme, the port number or the full URL. The query component also gets plus-to-space conversion as a bonus when this bit is set. -Note that this URL decoding is charset unaware and you get a zero terminated +Note that this URL decoding is charset unaware and you get a null-terminated string back with data that could be intended for a particular encoding. If there are byte values lower than 32 in the decoded string, the get diff --git a/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md b/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md index 5307e55800..897cda42c2 100644 --- a/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md +++ b/docs/libcurl/opts/CURLOPT_PREREQFUNCTION.md @@ -58,14 +58,14 @@ This function is passed the following arguments: ## `conn_primary_ip` -A null-terminated pointer to a C string containing the primary IP of the +A pointer to a null-terminated C string containing the primary IP of the remote server established with this connection. For FTP, this is the IP for the control connection. IPv6 addresses are represented without surrounding brackets. ## `conn_local_ip` -A null-terminated pointer to a C string containing the originating IP for this +A pointer to a null-terminated C string containing the originating IP for this connection. IPv6 addresses are represented without surrounding brackets. ## `conn_primary_port` diff --git a/include/curl/curl.h b/include/curl/curl.h index 128d1d3d00..fb225c7903 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -2813,17 +2813,17 @@ struct curl_slist { * *before* curl_global_init(). * * The backend can be identified by the id (e.g. CURLSSLBACKEND_OPENSSL). The - * backend can also be specified via the name parameter (passing -1 as id). - * If both id and name are specified, the name will be ignored. If neither id - * nor name are specified, the function will fail with - * CURLSSLSET_UNKNOWN_BACKEND and set the "avail" pointer to the - * NULL-terminated list of available backends. + * backend can also be specified via the name parameter (passing -1 as id). If + * both id and name are specified, the name will be ignored. If neither id nor + * name are specified, the function will fail with CURLSSLSET_UNKNOWN_BACKEND + * and set the "avail" pointer to the NULL-terminated list of available + * backends. * * Upon success, the function returns CURLSSLSET_OK. * * If the specified SSL backend is not available, the function returns - * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a NULL-terminated - * list of available SSL backends. + * CURLSSLSET_UNKNOWN_BACKEND and sets the "avail" pointer to a + * NULL-terminated list of available SSL backends. * * The SSL backend can be set only once. If it has already been set, a * subsequent attempt to change it will result in a CURLSSLSET_TOO_LATE. diff --git a/lib/altsvc.c b/lib/altsvc.c index 8a29ca4626..602ef61def 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -190,7 +190,7 @@ static CURLcode altsvc_add(struct altsvcinfo *asi, const char *line) char dbuf[MAX_ALTSVC_DATELEN + 1]; time_t expires; - /* The date parser works on a null terminated string. The maximum length + /* The date parser works on a null-terminated string. The maximum length is upheld by curlx_str_quotedword(). */ memcpy(dbuf, curlx_str(&date), curlx_strlen(&date)); dbuf[curlx_strlen(&date)] = 0; diff --git a/lib/curl_addrinfo.c b/lib/curl_addrinfo.c index 8bfde69988..b131c747b1 100644 --- a/lib/curl_addrinfo.c +++ b/lib/curl_addrinfo.c @@ -468,7 +468,7 @@ struct Curl_addrinfo *Curl_unix2addr(const char *path, bool *longpath, sa_un = (void *) ai->ai_addr; sa_un->sun_family = AF_UNIX; - /* sun_path must be able to store the NUL-terminated path */ + /* sun_path must be able to store the null-terminated path */ path_len = strlen(path) + 1; if(path_len > sizeof(sa_un->sun_path)) { free(ai); diff --git a/lib/curlx/base64.c b/lib/curlx/base64.c index 80624cc296..92ebc57e1e 100644 --- a/lib/curlx/base64.c +++ b/lib/curlx/base64.c @@ -61,9 +61,9 @@ static const unsigned char decodetable[] = /* * curlx_base64_decode() * - * Given a base64 NUL-terminated string at src, decode it and return a - * pointer in *outptr to a newly allocated memory area holding decoded - * data. Size of decoded data is returned in variable pointed by outlen. + * Given a base64 null-terminated string at src, decode it and return a + * pointer in *outptr to a newly allocated memory area holding decoded data. + * Size of decoded data is returned in variable pointed by outlen. * * Returns CURLE_OK on success, otherwise specific error code. Function * output shall not be considered valid unless CURLE_OK is returned. @@ -247,7 +247,7 @@ static CURLcode base64_encode(const char *table64, * encoded data. Size of encoded data is returned in variable pointed by * outlen. * - * Input length of 0 indicates input buffer holds a NUL-terminated string. + * Input length of 0 indicates input buffer holds a null-terminated string. * * Returns CURLE_OK on success, otherwise specific error code. Function * output shall not be considered valid unless CURLE_OK is returned. @@ -269,7 +269,7 @@ CURLcode curlx_base64_encode(const char *inputbuff, size_t insize, * encoded data. Size of encoded data is returned in variable pointed by * outlen. * - * Input length of 0 indicates input buffer holds a NUL-terminated string. + * Input length of 0 indicates input buffer holds a null-terminated string. * * Returns CURLE_OK on success, otherwise specific error code. Function * output shall not be considered valid unless CURLE_OK is returned. diff --git a/lib/dynhds.h b/lib/dynhds.h index 7cd5da472a..e533dcc369 100644 --- a/lib/dynhds.h +++ b/lib/dynhds.h @@ -32,7 +32,7 @@ struct dynbuf; /** * A single header entry. - * `name` and `value` are non-NULL and always NUL terminated. + * `name` and `value` are non-NULL and always null-terminated. */ struct dynhds_entry { char *name; @@ -113,7 +113,7 @@ size_t Curl_dynhds_count_name(struct dynhds *dynhds, const char *name, size_t namelen); /** - * Return how often the given 0-terminated name appears in `dynhds`. + * Return how often the given null-terminated name appears in `dynhds`. * Names are case-insensitive. */ size_t Curl_dynhds_ccount_name(struct dynhds *dynhds, const char *name); diff --git a/lib/headers.c b/lib/headers.c index ec3ac7473c..71592a9c73 100644 --- a/lib/headers.c +++ b/lib/headers.c @@ -217,7 +217,7 @@ static CURLcode namevalue(char *header, size_t hlen, unsigned int type, /* skip all trailing space letters */ while((end > header) && ISBLANK(*end)) - *end-- = 0; /* nul terminate */ + *end-- = 0; /* null-terminate */ return CURLE_OK; } @@ -323,7 +323,7 @@ CURLcode Curl_headers_push(struct Curl_easy *data, const char *header, if(!hs) return CURLE_OUT_OF_MEMORY; memcpy(hs->buffer, header, hlen); - hs->buffer[hlen] = 0; /* nul terminate */ + hs->buffer[hlen] = 0; /* null-terminate */ result = namevalue(hs->buffer, hlen, type, &name, &value); if(!result) { diff --git a/lib/hsts.c b/lib/hsts.c index ccfc55dd29..62a3f89058 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -279,7 +279,7 @@ struct stsentry *Curl_hsts(struct hsts *h, const char *hostname, blen = ntail; } } - /* avoid strcasecompare because the host name is not null terminated */ + /* avoid strcasecompare because the host name is not null-terminated */ if((hlen == ntail) && strncasecompare(hostname, sts->host, hlen)) return sts; } @@ -430,7 +430,7 @@ static CURLcode hsts_add(struct hsts *h, const char *line) time_t expires; const char *hp = curlx_str(&host); - /* The date parser works on a null terminated string. The maximum length + /* The date parser works on a null-terminated string. The maximum length is upheld by curlx_str_quotedword(). */ memcpy(dbuf, curlx_str(&date), curlx_strlen(&date)); dbuf[curlx_strlen(&date)] = 0; diff --git a/lib/http1.c b/lib/http1.c index a0ec255675..537e6db2ff 100644 --- a/lib/http1.c +++ b/lib/http1.c @@ -209,7 +209,7 @@ static CURLcode start_req(struct h1_req_parser *parser, path = target; path_len = target_len; - /* URL parser wants 0-termination */ + /* URL parser wants null-termination */ if(target_len >= sizeof(tmp)) goto out; memcpy(tmp, target, target_len); diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index aa8945d3c0..0d2e2b9f15 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -133,7 +133,7 @@ static void trim_headers(struct curl_slist *head) else *store++ = *value++; } - *store = 0; /* null terminate */ + *store = 0; /* null-terminate */ } } diff --git a/lib/noproxy.c b/lib/noproxy.c index 0ecd8e1787..f70f57eb5a 100644 --- a/lib/noproxy.c +++ b/lib/noproxy.c @@ -234,7 +234,7 @@ bool Curl_check_noproxy(const char *name, const char *no_proxy) /* if the bits variable gets a crazy value here, that is fine as the value will then be rejected in the cidr function */ bits = (unsigned int)atoi(slash + 1); - *slash = 0; /* null terminate there */ + *slash = 0; /* null-terminate there */ } if(type == TYPE_IPV6) match = Curl_cidr6_match(name, check, bits); diff --git a/lib/smb.c b/lib/smb.c index c8d03ddbc4..ceca9564bf 100644 --- a/lib/smb.c +++ b/lib/smb.c @@ -723,7 +723,7 @@ static CURLcode smb_send_setup(struct Curl_easy *data) "%s%c" /* OS */ "%s", /* client name */ smbc->user, 0, smbc->domain, 0, CURL_OS, 0, CLIENTNAME); - p++; /* count the final null termination */ + p++; /* count the final null-termination */ DEBUGASSERT(byte_count == (size_t)(p - msg.bytes)); msg.byte_count = smb_swap16((unsigned short)byte_count); @@ -754,7 +754,7 @@ static CURLcode smb_send_tree_connect(struct Curl_easy *data, "%s%c" /* share */ "%s", /* service */ conn->host.name, smbc->share, 0, SERVICENAME); - p++; /* count the final null termination */ + p++; /* count the final null-termination */ DEBUGASSERT(byte_count == (size_t)(p - msg.bytes)); msg.byte_count = smb_swap16((unsigned short)byte_count); diff --git a/lib/socks.c b/lib/socks.c index 18cefe8bc8..08bc874f11 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -394,7 +394,7 @@ CONNECT_REQ_INIT: /* * This is currently not supporting "Identification Protocol (RFC1413)". */ - socksreq[8] = 0; /* ensure empty userid is NUL-terminated */ + socksreq[8] = 0; /* ensure empty userid is null-terminated */ if(sx->proxy_user) { size_t plen = strlen(sx->proxy_user); if(plen > 255) { diff --git a/lib/strcase.c b/lib/strcase.c index 841949ec5e..ee5b9072c4 100644 --- a/lib/strcase.c +++ b/lib/strcase.c @@ -85,7 +85,7 @@ char Curl_raw_tolower(char in) /* Copy an upper case version of the string from src to dest. The * strings may overlap. No more than n characters of the string are copied * (including any NUL) and the destination string will NOT be - * NUL-terminated if that limit is reached. + * null-terminated if that limit is reached. */ void Curl_strntoupper(char *dest, const char *src, size_t n) { @@ -100,7 +100,7 @@ void Curl_strntoupper(char *dest, const char *src, size_t n) /* Copy a lower case version of the string from src to dest. The * strings may overlap. No more than n characters of the string are copied * (including any NUL) and the destination string will NOT be - * NUL-terminated if that limit is reached. + * null-terminated if that limit is reached. */ void Curl_strntolower(char *dest, const char *src, size_t n) { @@ -112,7 +112,7 @@ void Curl_strntolower(char *dest, const char *src, size_t n) } while(*src++ && --n); } -/* Compare case-sensitive NUL-terminated strings, taking care of possible +/* Compare case-sensitive null-terminated strings, taking care of possible * null pointers. Return true if arguments match. */ bool Curl_safecmp(char *a, char *b) diff --git a/lib/strdup.c b/lib/strdup.c index 9fceaea892..69c41a5e25 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -104,7 +104,7 @@ void *Curl_memdup(const void *src, size_t length) * Curl_memdup0(source, length) * * Copies the 'source' string to a newly allocated buffer (that is returned). - * Copies 'length' bytes then adds a null terminator. + * Copies 'length' bytes then adds a null-terminator. * * Returns the new pointer or NULL on failure. * diff --git a/lib/system_win32.c b/lib/system_win32.c index b1fd12bea0..5212887580 100644 --- a/lib/system_win32.c +++ b/lib/system_win32.c @@ -214,7 +214,7 @@ HMODULE Curl_load_library(LPCTSTR filename) /* Attempt to get the Windows system path */ UINT systemdirlen = GetSystemDirectory(NULL, 0); if(systemdirlen) { - /* Allocate space for the full DLL path (Room for the null terminator + /* Allocate space for the full DLL path (Room for the null-terminator is included in systemdirlen) */ size_t filenamelen = _tcslen(filename); TCHAR *path = malloc(sizeof(TCHAR) * (systemdirlen + 1 + filenamelen)); diff --git a/lib/transfer.h b/lib/transfer.h index bfc42188e0..2c355e0e9d 100644 --- a/lib/transfer.h +++ b/lib/transfer.h @@ -59,7 +59,7 @@ bool Curl_xfer_write_is_paused(struct Curl_easy *data); /** * Write a single "header" line from a server response. - * @param hd0 the 0-terminated, single header line + * @param hd0 the null-terminated, single header line * @param hdlen the length of the header line * @param is_eos TRUE iff this is the end of the response */ diff --git a/lib/vauth/digest.c b/lib/vauth/digest.c index d99dac194c..ec4e82256c 100644 --- a/lib/vauth/digest.c +++ b/lib/vauth/digest.c @@ -165,7 +165,7 @@ static char *auth_digest_string_quoted(const char *source) { char *dest; const char *s = source; - size_t n = 1; /* null terminator */ + size_t n = 1; /* null-terminator */ /* Calculate size needed */ while(*s) { diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 3e8aade54b..c16b3ac388 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -2007,7 +2007,7 @@ static CURLcode ssh_state_sftp_realpath(struct Curl_easy *data, return CURLE_AGAIN; if(rc > 0) { - /* It seems that this string is not always NULL terminated */ + /* It seems that this string is not always null-terminated */ sshp->readdir_filename[rc] = '\0'; free(sshc->homedir); sshc->homedir = strdup(sshp->readdir_filename); diff --git a/lib/vtls/schannel_verify.c b/lib/vtls/schannel_verify.c index efa240534f..f843342b9c 100644 --- a/lib/vtls/schannel_verify.c +++ b/lib/vtls/schannel_verify.c @@ -331,7 +331,7 @@ static CURLcode add_certs_file_to_store(HCERTSTORE trust_store, } } - /* Null terminate the buffer */ + /* null-terminate the buffer */ ca_file_buffer[ca_file_bufsize] = '\0'; result = add_certs_data_to_store(trust_store, diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index 2f2c544a8e..c6fb60d0a4 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -768,8 +768,8 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, do { end_pos = strstr(begin_pos, ";sha256//"); /* - * if there is an end_pos, null terminate, - * otherwise it will go to the end of the original string + * if there is an end_pos, null-terminate, otherwise it will go to the + * end of the original string */ if(end_pos) end_pos[0] = '\0'; @@ -845,8 +845,8 @@ CURLcode Curl_pin_peer_pubkey(struct Curl_easy *data, } /* - * Otherwise we will assume it is PEM and try to decode it - * after placing null terminator + * Otherwise we will assume it is PEM and try to decode it after placing + * null-terminator */ pem_read = pubkey_pem_to_der(curlx_dyn_ptr(&buf), &pem_ptr, &pem_len); /* if it was not read successfully, exit */ diff --git a/lib/vtls/vtls_scache.c b/lib/vtls/vtls_scache.c index 52e81568ee..1fe4b5bbde 100644 --- a/lib/vtls/vtls_scache.c +++ b/lib/vtls/vtls_scache.c @@ -598,9 +598,8 @@ CURLcode Curl_ssl_peer_key_make(struct Curl_cfilter *cf, goto out; *ppeer_key = curlx_dyn_take(&buf, &key_len); - /* we just added printable char, and dynbuf always 0 terminates, - * no need to track length */ - + /* we just added printable char, and dynbuf always null-terminates, no need + * to track length */ out: curlx_dyn_free(&buf); diff --git a/lib/vtls/x509asn1.c b/lib/vtls/x509asn1.c index dd2aa145af..c6246cbd09 100644 --- a/lib/vtls/x509asn1.c +++ b/lib/vtls/x509asn1.c @@ -256,7 +256,7 @@ static const char *getASN1Element(struct Curl_asn1Element *elem, #ifdef WANT_EXTRACT_CERTINFO /* - * Search the null terminated OID or OID identifier in local table. + * Search the null-terminated OID or OID identifier in local table. * Return the table entry pointer or NULL if not found. */ static const struct Curl_OID *searchOID(const char *oid) diff --git a/packages/OS400/rpg-examples/HEADERAPI b/packages/OS400/rpg-examples/HEADERAPI index 2c2407ea24..2046306bb8 100644 --- a/packages/OS400/rpg-examples/HEADERAPI +++ b/packages/OS400/rpg-examples/HEADERAPI @@ -135,7 +135,7 @@ * d len s 10u 0 * - len = %scan(X'00': string: 1: length); // Limit to zero-terminated string + len = %scan(X'00': string: 1: length); // Limit to null-terminated string if len = 0; len = length + 1; endif; diff --git a/packages/OS400/rpg-examples/HTTPPOST b/packages/OS400/rpg-examples/HTTPPOST index 21202ebe02..9a562e9084 100644 --- a/packages/OS400/rpg-examples/HTTPPOST +++ b/packages/OS400/rpg-examples/HTTPPOST @@ -118,7 +118,7 @@ * d len s 10u 0 * - len = %scan(X'00': string: 1: length); // Limit to zero-terminated string + len = %scan(X'00': string: 1: length); // Limit to null-terminated string if len = 0; len = length + 1; endif; diff --git a/packages/OS400/rpg-examples/INMEMORY b/packages/OS400/rpg-examples/INMEMORY index e6f43abc84..ab425fc22f 100644 --- a/packages/OS400/rpg-examples/INMEMORY +++ b/packages/OS400/rpg-examples/INMEMORY @@ -148,7 +148,7 @@ * d len s 10u 0 * - len = %scan(X'00': string: 1: length); // Limit to zero-terminated string + len = %scan(X'00': string: 1: length); // Limit to null-terminated string if len = 0; len = length + 1; endif; diff --git a/packages/OS400/rpg-examples/SIMPLE1 b/packages/OS400/rpg-examples/SIMPLE1 index 52c0c93e89..e1286d1215 100644 --- a/packages/OS400/rpg-examples/SIMPLE1 +++ b/packages/OS400/rpg-examples/SIMPLE1 @@ -97,7 +97,7 @@ * d len s 10u 0 * - c eval len = %scan(X'00': string: 1: length) Limit 0-terminated + c eval len = %scan(X'00': string: 1: length) Limit null-terminated c if len = 0 c eval len = length + 1 c endif diff --git a/packages/OS400/rpg-examples/SIMPLE2 b/packages/OS400/rpg-examples/SIMPLE2 index 493c91ee23..b0c590cc29 100644 --- a/packages/OS400/rpg-examples/SIMPLE2 +++ b/packages/OS400/rpg-examples/SIMPLE2 @@ -97,7 +97,7 @@ dcl-s len uns(10); - len = %scan(X'00': string: 1: length); // Limit to zero-terminated string + len = %scan(X'00': string: 1: length); // Limit to null-terminated string if len = 0; len = length + 1; endif; diff --git a/packages/OS400/rpg-examples/SMTPSRCMBR b/packages/OS400/rpg-examples/SMTPSRCMBR index 88f4fd25ca..d11ea96307 100644 --- a/packages/OS400/rpg-examples/SMTPSRCMBR +++ b/packages/OS400/rpg-examples/SMTPSRCMBR @@ -228,7 +228,7 @@ d addrdiff s 10i 0 d len s 10u 0 * - len = %scan(X'00': string: 1: length); // Limit to zero-terminated string + len = %scan(X'00': string: 1: length); // Limit to null-terminated string if len = 0; len = length + 1; endif; diff --git a/packages/vms/curl_crtl_init.c b/packages/vms/curl_crtl_init.c index a94fb6664b..90bcb4c359 100644 --- a/packages/vms/curl_crtl_init.c +++ b/packages/vms/curl_crtl_init.c @@ -131,7 +131,7 @@ static int sys_trnlnm(const char *logname, if($VMS_STATUS_SUCCESS(status)) { - /* Null terminate and return the string */ + /* Null-terminate and return the string */ /*--------------------------------------*/ value[result] = '\0'; } diff --git a/src/tool_cb_hdr.c b/src/tool_cb_hdr.c index 92952f2ff3..151fd5c0ff 100644 --- a/src/tool_cb_hdr.c +++ b/src/tool_cb_hdr.c @@ -248,7 +248,7 @@ size_t tool_header_cb(char *ptr, size_t size, size_t nmemb, void *userdata) if(hdrcbdata->honor_cd_filename && hdrcbdata->config->show_headers) { /* still awaiting the Content-Disposition header, store the header in - memory. Since it is not zero terminated, we need an extra dance. */ + memory. Since it is not null-terminated, we need an extra dance. */ char *clone = aprintf("%.*s", (int)cb, str); if(clone) { struct curl_slist *old = hdrcbdata->headlist; @@ -440,7 +440,7 @@ void write_linked_location(CURL *curl, const char *location, size_t loclen, if(!u) goto locout; - /* Create a NUL-terminated and whitespace-stripped copy of Location: */ + /* Create a null-terminated and whitespace-stripped copy of Location: */ copyloc = malloc(llen + 1); if(!copyloc) goto locout; diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 39defe9e31..9c1f1e54e9 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -78,7 +78,7 @@ static ParameterError getstrn(char **str, const char *val, return PARAM_NO_MEM; memcpy(*str, val, len); - (*str)[len] = 0; /* null terminate */ + (*str)[len] = 0; /* null-terminate */ return PARAM_OK; } diff --git a/src/tool_parsecfg.c b/src/tool_parsecfg.c index 0c59bdef78..d5f144274a 100644 --- a/src/tool_parsecfg.c +++ b/src/tool_parsecfg.c @@ -237,10 +237,10 @@ int parseconfig(const char *filename, struct GlobalConfig *global) /* * Copies the string from line to the buffer at param, unquoting - * backslash-quoted characters and NUL-terminating the output string. - * Stops at the first non-backslash-quoted double quote character or the - * end of the input string. param must be at least as long as the input - * string. Returns the pointer after the last handled input character. + * backslash-quoted characters and null-terminating the output string. Stops + * at the first non-backslash-quoted double quote character or the end of the + * input string. param must be at least as long as the input string. Returns + * the pointer after the last handled input character. */ static const char *unslashquote(const char *line, char *param) { @@ -317,7 +317,7 @@ static bool get_line(FILE *input, struct dynbuf *buf, bool *error) } /* - * Returns a line from the given file. Every line is NULL terminated (no + * Returns a line from the given file. Every line is null-terminated (no * newline). Skips #-commented and space/tabs-only lines automatically. */ bool my_get_line(FILE *input, struct dynbuf *buf, bool *error) diff --git a/tests/libtest/stub_gssapi.c b/tests/libtest/stub_gssapi.c index b5fa5849c7..956ec3782b 100644 --- a/tests/libtest/stub_gssapi.c +++ b/tests/libtest/stub_gssapi.c @@ -227,7 +227,7 @@ OM_uint32 gss_init_sec_context(OM_uint32 *min, return GSS_S_FAILURE; } - /* Overwrite null terminator */ + /* Overwrite null-terminator */ memset(token + used, 'A', length - used); *context_handle = ctx; diff --git a/tests/server/getpart.c b/tests/server/getpart.c index 42c96a2631..3ee836140a 100644 --- a/tests/server/getpart.c +++ b/tests/server/getpart.c @@ -163,7 +163,7 @@ static int readline(char **buffer, size_t *bufsize, size_t *length, * * If the source buffer is indicated to be base64 encoded, this appends the * decoded data, binary or whatever, to the destination. The source buffer - * may not hold binary data, only a null terminated string is valid content. + * may not hold binary data, only a null-terminated string is valid content. * * Destination buffer will be enlarged and relocated as needed. * @@ -264,7 +264,7 @@ static int decodedata(char **buf, /* dest buffer */ * and the size of the data is stored at the addresses that caller specifies. * * If the returned data is a string the returned size will be the length of - * the string excluding null termination. Otherwise it will just be the size + * the string excluding null-termination. Otherwise it will just be the size * of the returned binary data. * * Calling function is responsible to free returned buffer.