mirror of
https://github.com/curl/curl.git
synced 2026-08-24 21:13:40 +03:00
snprintf: renamed and we now only use msnprintf()
The function does not return the same value as snprintf() normally does, so readers may be mislead into thinking the code works differently than it actually does. A different function name makes this easier to detect. Reported-by: Tomas Hoger Assisted-by: Daniel Gustafsson Fixes #3296 Closes #3297
This commit is contained in:
parent
9944d6ba33
commit
dcd6f81025
92 changed files with 632 additions and 631 deletions
40
lib/http.c
40
lib/http.c
|
|
@ -1478,14 +1478,14 @@ static CURLcode add_haproxy_protocol_header(struct connectdata *conn)
|
|||
strcpy(tcp_version, "TCP4");
|
||||
}
|
||||
|
||||
snprintf(proxy_header,
|
||||
sizeof(proxy_header),
|
||||
"PROXY %s %s %s %li %li\r\n",
|
||||
tcp_version,
|
||||
conn->data->info.conn_local_ip,
|
||||
conn->data->info.conn_primary_ip,
|
||||
conn->data->info.conn_local_port,
|
||||
conn->data->info.conn_primary_port);
|
||||
msnprintf(proxy_header,
|
||||
sizeof(proxy_header),
|
||||
"PROXY %s %s %s %li %li\r\n",
|
||||
tcp_version,
|
||||
conn->data->info.conn_local_ip,
|
||||
conn->data->info.conn_primary_ip,
|
||||
conn->data->info.conn_local_port,
|
||||
conn->data->info.conn_primary_port);
|
||||
|
||||
req_buffer = Curl_add_buffer_init();
|
||||
if(!req_buffer)
|
||||
|
|
@ -1849,16 +1849,16 @@ CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
|||
*/
|
||||
|
||||
/* format: "Tue, 15 Nov 1994 12:45:26 GMT" */
|
||||
snprintf(datestr, sizeof(datestr),
|
||||
"%s: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
|
||||
condp,
|
||||
Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
|
||||
tm->tm_mday,
|
||||
Curl_month[tm->tm_mon],
|
||||
tm->tm_year + 1900,
|
||||
tm->tm_hour,
|
||||
tm->tm_min,
|
||||
tm->tm_sec);
|
||||
msnprintf(datestr, sizeof(datestr),
|
||||
"%s: %s, %02d %s %4d %02d:%02d:%02d GMT\r\n",
|
||||
condp,
|
||||
Curl_wkday[tm->tm_wday?tm->tm_wday-1:6],
|
||||
tm->tm_mday,
|
||||
Curl_month[tm->tm_mon],
|
||||
tm->tm_year + 1900,
|
||||
tm->tm_hour,
|
||||
tm->tm_min,
|
||||
tm->tm_sec);
|
||||
|
||||
result = Curl_add_buffer(&req_buffer, datestr, strlen(datestr));
|
||||
|
||||
|
|
@ -2292,8 +2292,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||
if(!*data->state.up.path && path[strlen(path) - 1] != '/') {
|
||||
*p++ = '/';
|
||||
}
|
||||
snprintf(p, sizeof(ftp_typecode) - 1, ";type=%c",
|
||||
data->set.prefer_ascii ? 'a' : 'i');
|
||||
msnprintf(p, sizeof(ftp_typecode) - 1, ";type=%c",
|
||||
data->set.prefer_ascii ? 'a' : 'i');
|
||||
}
|
||||
}
|
||||
if(conn->bits.user_passwd && !conn->bits.userpwd_in_url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue