summaryrefslogtreecommitdiff
path: root/lib/urlapi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-11-22 09:01:24 +0100
committerDaniel Stenberg <daniel@haxx.se>2018-11-23 08:26:51 +0100
commitdcd6f810255785d52b89150e18460fb0899d4f7e (patch)
treec3cb7cdcb79dbf752edcd997934e44a2e9998397 /lib/urlapi.c
parent9944d6ba334f07b0b6199bdb5bb82091c88c16ed (diff)
downloadcurl-dcd6f810255785d52b89150e18460fb0899d4f7e.tar.gz
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
Diffstat (limited to 'lib/urlapi.c')
-rw-r--r--lib/urlapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c
index 2830dc163..be9958cd8 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
@@ -203,7 +203,7 @@ void Curl_strcpy_url(char *output, const char *url, bool relative)
/* FALLTHROUGH */
default:
if(urlchar_needs_escaping(*iptr)) {
- snprintf(optr, 4, "%%%02x", *iptr);
+ msnprintf(optr, 4, "%%%02x", *iptr);
optr += 3;
}
else
@@ -531,7 +531,7 @@ static CURLUcode parse_port(struct Curl_URL *u, char *hostname)
*portptr++ = '\0'; /* cut off the name there */
*rest = 0;
/* generate a new to get rid of leading zeroes etc */
- snprintf(portbuf, sizeof(portbuf), "%ld", port);
+ msnprintf(portbuf, sizeof(portbuf), "%ld", port);
u->portnum = port;
u->port = strdup(portbuf);
if(!u->port)
@@ -964,7 +964,7 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what,
const struct Curl_handler *h =
Curl_builtin_scheme(u->scheme);
if(h) {
- snprintf(portbuf, sizeof(portbuf), "%ld", h->defport);
+ msnprintf(portbuf, sizeof(portbuf), "%ld", h->defport);
ptr = portbuf;
}
}
@@ -1023,7 +1023,7 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what,
/* there's no stored port number, but asked to deliver
a default one for the scheme */
if(h) {
- snprintf(portbuf, sizeof(portbuf), "%ld", h->defport);
+ msnprintf(portbuf, sizeof(portbuf), "%ld", h->defport);
port = portbuf;
}
}
@@ -1287,7 +1287,7 @@ CURLUcode curl_url_set(CURLU *u, CURLUPart what,
o++;
}
else {
- snprintf(o, 4, "%%%02x", *i);
+ msnprintf(o, 4, "%%%02x", *i);
o += 3;
}
}