diff options
author | Daniel Stenberg <daniel@haxx.se> | 2020-06-25 11:38:25 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2020-06-25 11:45:17 +0200 |
commit | d6c67eae703575387b1d5be5e9cd110d04914cab (patch) | |
tree | beef06c929271c248242e78e179e5d6d0f2957f9 /lib | |
parent | 8acfb932ef9be1209491bc68d38445c4d6eaab6e (diff) | |
download | curl-d6c67eae703575387b1d5be5e9cd110d04914cab.tar.gz |
terminology: call them null-terminated stringsbagder/null-terminate
Updated terminology in docs, comments and phrases to refer to C strings
as "null-terminated". Done to unify with how most other C oriented docs
refer of them and what users in general seem to prefer (based on a
single highly unscientific poll on twitter).
Reported-by: coinhubs on github
Fixes #5598
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cookie.c | 2 | ||||
-rw-r--r-- | lib/dotdot.c | 10 | ||||
-rw-r--r-- | lib/dynbuf.c | 2 | ||||
-rw-r--r-- | lib/dynbuf.h | 2 | ||||
-rw-r--r-- | lib/formdata.c | 4 | ||||
-rw-r--r-- | lib/ftp.c | 4 | ||||
-rw-r--r-- | lib/http.c | 2 | ||||
-rw-r--r-- | lib/mime.c | 2 | ||||
-rw-r--r-- | lib/pingpong.c | 4 | ||||
-rw-r--r-- | lib/strerror.c | 2 | ||||
-rw-r--r-- | lib/strtok.c | 4 | ||||
-rw-r--r-- | lib/urlapi.c | 8 | ||||
-rw-r--r-- | lib/urldata.h | 2 | ||||
-rw-r--r-- | lib/vtls/openssl.c | 2 | ||||
-rw-r--r-- | lib/vtls/vtls.c | 6 |
15 files changed, 28 insertions, 28 deletions
diff --git a/lib/cookie.c b/lib/cookie.c index 68054e1c4..cb7d94b10 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -755,7 +755,7 @@ Curl_cookie_add(struct Curl_easy *data, co->path = malloc(pathlen + 1); /* one extra for the zero byte */ if(co->path) { memcpy(co->path, path, pathlen); - co->path[pathlen] = 0; /* zero terminate */ + co->path[pathlen] = 0; /* null-terminate */ co->spath = sanitize_cookie_path(co->path); if(!co->spath) badcookie = TRUE; /* out of memory bad */ diff --git a/lib/dotdot.c b/lib/dotdot.c index fe4f4971f..ce9a05214 100644 --- a/lib/dotdot.c +++ b/lib/dotdot.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -39,7 +39,7 @@ * Curl_dedotdotify() * @unittest: 1395 * - * This function gets a zero-terminated path with dot and dotdot sequences + * This function gets a null-terminated path with dot and dotdot sequences * passed in and strips them off according to the rules in RFC 3986 section * 5.2.4. * @@ -62,7 +62,7 @@ char *Curl_dedotdotify(const char *input) if(!out) return NULL; /* out of memory */ - *out = 0; /* zero terminates, for inputs like "./" */ + *out = 0; /* null-terminates, for inputs like "./" */ /* get a cloned copy of the input */ clone = strdup(input); @@ -129,7 +129,7 @@ char *Curl_dedotdotify(const char *input) if(*outptr == '/') break; } - *outptr = 0; /* zero-terminate where it stops */ + *outptr = 0; /* null-terminate where it stops */ } else if(!strcmp("/..", clone)) { clone[2]='/'; @@ -141,7 +141,7 @@ char *Curl_dedotdotify(const char *input) if(*outptr == '/') break; } - *outptr = 0; /* zero-terminate where it stops */ + *outptr = 0; /* null-terminate where it stops */ } /* D. if the input buffer consists only of "." or "..", then remove diff --git a/lib/dynbuf.c b/lib/dynbuf.c index dfc1d05c6..38d370b07 100644 --- a/lib/dynbuf.c +++ b/lib/dynbuf.c @@ -161,7 +161,7 @@ CURLcode Curl_dyn_addn(struct dynbuf *s, const void *mem, size_t len) } /* - * Append a zero terminated string at the end. + * Append a null-terminated string at the end. */ CURLcode Curl_dyn_add(struct dynbuf *s, const char *str) { diff --git a/lib/dynbuf.h b/lib/dynbuf.h index 7809becfe..c80239e29 100644 --- a/lib/dynbuf.h +++ b/lib/dynbuf.h @@ -23,7 +23,7 @@ ***************************************************************************/ struct dynbuf { - char *bufr; /* point to a zero terminated allocated buffer */ + char *bufr; /* point to a null-terminated allocated buffer */ size_t leng; /* number of bytes *EXCLUDING* the zero terminator */ size_t allc; /* size of the current allocation */ size_t toobig; /* size limit for the buffer */ diff --git a/lib/formdata.c b/lib/formdata.c index dfa44bc76..1cab2c5c2 100644 --- a/lib/formdata.c +++ b/lib/formdata.c @@ -602,7 +602,7 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost, /* Note that there's small risk that form->name is NULL here if the app passed in a bad combo, so we better check for that first. */ if(form->name) { - /* copy name (without strdup; possibly not nul-terminated) */ + /* copy name (without strdup; possibly not null-terminated) */ form->name = Curl_memdup(form->name, form->namelength? form->namelength: strlen(form->name) + 1); @@ -771,7 +771,7 @@ void curl_formfree(struct curl_httppost *form) } -/* Set mime part name, taking care of non nul-terminated name string. */ +/* Set mime part name, taking care of non null-terminated name string. */ static CURLcode setname(curl_mimepart *part, const char *name, size_t len) { char *zname; @@ -2827,7 +2827,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn) store++; ptr++; } - *store = '\0'; /* zero terminate */ + *store = '\0'; /* null-terminate */ } if(entry_extracted) { /* If the path name does not look like an absolute path (i.e.: it @@ -2891,7 +2891,7 @@ static CURLcode ftp_statemach_act(struct connectdata *conn) ptr++; for(store = os; *ptr && *ptr != ' ';) *store++ = *ptr++; - *store = '\0'; /* zero terminate */ + *store = '\0'; /* null-terminate */ /* Check for special servers here. */ diff --git a/lib/http.c b/lib/http.c index 19e471ee6..1ab897281 100644 --- a/lib/http.c +++ b/lib/http.c @@ -270,7 +270,7 @@ char *Curl_copy_header_value(const char *header) return NULL; memcpy(value, start, len); - value[len] = 0; /* zero terminate */ + value[len] = 0; /* null-terminate */ return value; } diff --git a/lib/mime.c b/lib/mime.c index 4a87c4a3f..6a9b64a2d 100644 --- a/lib/mime.c +++ b/lib/mime.c @@ -1419,7 +1419,7 @@ CURLcode curl_mime_data(curl_mimepart *part, if(datasize) memcpy(part->data, data, datasize); - part->data[datasize] = '\0'; /* Set a nul terminator as sentinel. */ + part->data[datasize] = '\0'; /* Set a null terminator as sentinel. */ part->readfunc = mime_mem_read; part->seekfunc = mime_mem_seek; diff --git a/lib/pingpong.c b/lib/pingpong.c index ced832ecf..314331521 100644 --- a/lib/pingpong.c +++ b/lib/pingpong.c @@ -384,10 +384,10 @@ CURLcode Curl_pp_readresp(curl_socket_t sockfd, if(pp->endofresp(conn, pp->linestart_resp, perline, code)) { /* This is the end of the last line, copy the last line to the - start of the buffer and zero terminate, for old times sake */ + start of the buffer and null-terminate, for old times sake */ size_t n = ptr - pp->linestart_resp; memmove(buf, pp->linestart_resp, n); - buf[n] = 0; /* zero terminate */ + buf[n] = 0; /* null-terminate */ keepon = FALSE; pp->linestart_resp = ptr + 1; /* advance pointer */ i++; /* skip this before getting out */ diff --git a/lib/strerror.c b/lib/strerror.c index 1a166bf01..015e588cf 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -795,7 +795,7 @@ const char *Curl_strerror(int err, char *buf, size_t buflen) #endif /* end of not Windows */ - buf[max] = '\0'; /* make sure the string is zero terminated */ + buf[max] = '\0'; /* make sure the string is null-terminated */ /* strip trailing '\r\n' or '\n'. */ p = strrchr(buf, '\n'); diff --git a/lib/strtok.c b/lib/strtok.c index be8f48128..ba6e0258a 100644 --- a/lib/strtok.c +++ b/lib/strtok.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -52,7 +52,7 @@ Curl_strtok_r(char *ptr, const char *sep, char **end) if(**end) { /* the end is not a null byte */ - **end = '\0'; /* zero terminate it! */ + **end = '\0'; /* null-terminate it! */ ++*end; /* advance the last pointer to beyond the null byte */ } diff --git a/lib/urlapi.c b/lib/urlapi.c index 398364b34..acbfb8287 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -225,7 +225,7 @@ static void strcpy_url(char *output, const char *url, bool relative) break; } } - *optr = 0; /* zero terminate output buffer */ + *optr = 0; /* null-terminate output buffer */ } @@ -584,7 +584,7 @@ static CURLUcode junkscan(const char *part) 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x7f, - 0x00 /* zero terminate */ + 0x00 /* null-terminate */ }; size_t n = strlen(part); size_t nfine = strcspn(part, badbytes); @@ -1398,7 +1398,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, i = (const unsigned char *)part; for(o = enc; *i; ++o, ++i) *o = (*i == ' ') ? '+' : *i; - *o = 0; /* zero terminate */ + *o = 0; /* null-terminate */ part = strdup(enc); if(!part) { free(enc); @@ -1422,7 +1422,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what, o += 3; } } - *o = 0; /* zero terminate */ + *o = 0; /* null-terminate */ newp = enc; if(free_part) free((char *)part); diff --git a/lib/urldata.h b/lib/urldata.h index 3e44be87e..1fc25196a 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -1564,7 +1564,7 @@ enum dupstring { STRING_DNS_LOCAL_IP4, STRING_DNS_LOCAL_IP6, - /* -- end of zero-terminated strings -- */ + /* -- end of null-terminated strings -- */ STRING_LASTZEROTERMINATED, diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index c822e6b09..2e9f900da 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -1636,7 +1636,7 @@ static CURLcode verifyhost(struct connectdata *conn, X509 *server_cert) type itself: for example for an IA5String the data will be ASCII" It has been however verified that in 0.9.6 and 0.9.7, IA5String - is always zero-terminated. + is always null-terminated. */ if((altlen == strlen(altptr)) && /* if this isn't true, there was an embedded zero in the name diff --git a/lib/vtls/vtls.c b/lib/vtls/vtls.c index dfe260139..1cce961a6 100644 --- a/lib/vtls/vtls.c +++ b/lib/vtls/vtls.c @@ -706,7 +706,7 @@ CURLcode Curl_ssl_init_certinfo(struct Curl_easy *data, int num) } /* - * 'value' is NOT a zero terminated string + * 'value' is NOT a null-terminated string */ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, int certnum, @@ -728,10 +728,10 @@ CURLcode Curl_ssl_push_certinfo_len(struct Curl_easy *data, /* sprintf the label and colon */ msnprintf(output, outlen, "%s:", label); - /* memcpy the value (it might not be zero terminated) */ + /* memcpy the value (it might not be null-terminated) */ memcpy(&output[labellen + 1], value, valuelen); - /* zero terminate the output */ + /* null-terminate the output */ output[labellen + 1 + valuelen] = 0; nl = Curl_slist_append_nodup(ci->certinfo[certnum], output); |