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
## 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
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).
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
## `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`
* *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.
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;
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);
/*
* 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.
* 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.
* 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.
/**
* 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;
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);
/* skip all trailing space letters */
while((end > header) && ISBLANK(*end))
- *end-- = 0; /* nul terminate */
+ *end-- = 0; /* null-terminate */
return CURLE_OK;
}
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) {
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;
}
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;
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);
else
*store++ = *value++;
}
- *store = 0; /* null terminate */
+ *store = 0; /* null-terminate */
}
}
/* 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);
"%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);
"%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);
/*
* 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) {
/* 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)
{
/* 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)
{
} 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)
* 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.
*
/* 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));
/**
* 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
*/
{
char *dest;
const char *s = source;
- size_t n = 1; /* null terminator */
+ size_t n = 1; /* null-terminator */
/* Calculate size needed */
while(*s) {
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);
}
}
- /* Null terminate the buffer */
+ /* null-terminate the buffer */
ca_file_buffer[ca_file_bufsize] = '\0';
result = add_certs_data_to_store(trust_store,
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';
}
/*
- * 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 */
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);
#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)
*
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;
*
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;
*
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;
*
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
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;
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;
if($VMS_STATUS_SUCCESS(status)) {
- /* Null terminate and return the string */
+ /* Null-terminate and return the string */
/*--------------------------------------*/
value[result] = '\0';
}
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;
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;
return PARAM_NO_MEM;
memcpy(*str, val, len);
- (*str)[len] = 0; /* null terminate */
+ (*str)[len] = 0; /* null-terminate */
return PARAM_OK;
}
/*
* 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)
{
}
/*
- * 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)
return GSS_S_FAILURE;
}
- /* Overwrite null terminator */
+ /* Overwrite null-terminator */
memset(token + used, 'A', length - used);
*context_handle = ctx;
*
* 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.
*
* 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.