summaryrefslogtreecommitdiff
path: root/lib/urlapi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-06-30 12:56:22 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-06-30 23:25:35 +0200
commitd696ee00eec865747daedfaeeb1a880cf7d9a65c (patch)
treedd25363e31588d57477c1ac82d428360123f7239 /lib/urlapi.c
parent63c76681827b5ae9017f6c981003cd75e5f127de (diff)
downloadcurl-d696ee00eec865747daedfaeeb1a880cf7d9a65c.tar.gz
lib: use %u instead of %ld for port number printf
Follow-up to 764c6bd3bf which changed the type of some port number fields. Detected by Coverity (CID 1486624) etc. Closes #7325
Diffstat (limited to 'lib/urlapi.c')
-rw-r--r--lib/urlapi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/urlapi.c b/lib/urlapi.c
index d6d92cf77..905c499d9 100644
--- a/lib/urlapi.c
+++ b/lib/urlapi.c
@@ -1155,7 +1155,7 @@ CURLUcode curl_url_get(CURLU *u, CURLUPart what,
const struct Curl_handler *h =
Curl_builtin_scheme(u->scheme);
if(h) {
- msnprintf(portbuf, sizeof(portbuf), "%ld", h->defport);
+ msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
ptr = portbuf;
}
}
@@ -1214,7 +1214,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) {
- msnprintf(portbuf, sizeof(portbuf), "%ld", h->defport);
+ msnprintf(portbuf, sizeof(portbuf), "%u", h->defport);
port = portbuf;
}
}