diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2018-05-06 20:32:24 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2018-05-14 09:42:27 +0200 |
commit | eb49683e5591900b0c79fd9649a5aaf5549ea61f (patch) | |
tree | b015e5222e63c65ab6231c40965f04f816d422ae | |
parent | 4062bc4d3e717a490292500025e842e4d0f90ff1 (diff) |
lib: Fix format specifiers
-rw-r--r-- | lib/ftp.c | 4 | ||||
-rw-r--r-- | lib/http.c | 4 | ||||
-rw-r--r-- | lib/http_proxy.c | 4 | ||||
-rw-r--r-- | lib/url.c | 2 | ||||
-rw-r--r-- | lib/vtls/mbedtls.c | 2 |
5 files changed, 8 insertions, 8 deletions
@@ -1910,13 +1910,13 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn, if(data->set.ftp_skip_ip) { /* told to ignore the remotely given IP but instead use the host we used for the control connection */ - infof(data, "Skip %d.%d.%d.%d for data connection, re-use %s instead\n", + infof(data, "Skip %u.%u.%u.%u for data connection, re-use %s instead\n", ip[0], ip[1], ip[2], ip[3], conn->host.name); ftpc->newhost = strdup(control_address(conn)); } else - ftpc->newhost = aprintf("%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); + ftpc->newhost = aprintf("%u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); if(!ftpc->newhost) return CURLE_OUT_OF_MEMORY; diff --git a/lib/http.c b/lib/http.c index e080ae513..ff1d6813a 100644 --- a/lib/http.c +++ b/lib/http.c @@ -1407,7 +1407,7 @@ static CURLcode add_haproxy_protocol_header(struct connectdata *conn) snprintf(proxy_header, sizeof proxy_header, - "PROXY %s %s %s %i %i\r\n", + "PROXY %s %s %s %li %li\r\n", tcp_version, conn->data->info.conn_local_ip, conn->data->info.conn_primary_ip, @@ -2132,7 +2132,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done) host, conn->bits.ipv6_ip?"]":""); else - conn->allocptr.host = aprintf("Host: %s%s%s:%hu\r\n", + conn->allocptr.host = aprintf("Host: %s%s%s:%d\r\n", conn->bits.ipv6_ip?"[":"", host, conn->bits.ipv6_ip?"]":"", diff --git a/lib/http_proxy.c b/lib/http_proxy.c index c1eb177dd..e10a48829 100644 --- a/lib/http_proxy.c +++ b/lib/http_proxy.c @@ -221,7 +221,7 @@ static CURLcode CONNECT(struct connectdata *conn, if(!req_buffer) return CURLE_OUT_OF_MEMORY; - host_port = aprintf("%s:%hu", hostname, remote_port); + host_port = aprintf("%s:%d", hostname, remote_port); if(!host_port) { Curl_add_buffer_free(req_buffer); return CURLE_OUT_OF_MEMORY; @@ -245,7 +245,7 @@ static CURLcode CONNECT(struct connectdata *conn, if(hostname != conn->host.name) ipv6_ip = (strchr(hostname, ':') != NULL); hostheader = /* host:port with IPv6 support */ - aprintf("%s%s%s:%hu", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"", + aprintf("%s%s%s:%d", ipv6_ip?"[":"", hostname, ipv6_ip?"]":"", remote_port); if(!hostheader) { Curl_add_buffer_free(req_buffer); @@ -3419,7 +3419,7 @@ static CURLcode parse_remote_port(struct Curl_easy *data, * stripped off. It would be better to work directly from the original * URL and simply replace the port part of it. */ - url = aprintf("%s://%s%s%s:%hu%s%s%s", conn->given->scheme, + url = aprintf("%s://%s%s%s:%d%s%s%s", conn->given->scheme, conn->bits.ipv6_ip?"[":"", conn->host.name, conn->bits.ipv6_ip?"]":"", conn->remote_port, data->state.slash_removed?"/":"", data->state.path, diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 4ec9fa18e..d7759dc84 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -815,7 +815,7 @@ static void Curl_mbedtls_session_free(void *ptr) static size_t Curl_mbedtls_version(char *buffer, size_t size) { unsigned int version = mbedtls_version_get_number(); - return snprintf(buffer, size, "mbedTLS/%d.%d.%d", version>>24, + return snprintf(buffer, size, "mbedTLS/%u.%u.%u", version>>24, (version>>16)&0xff, (version>>8)&0xff); } |