mirror of https://github.com/moparisthebest/curl
lib: fix type of len passed to *printf's %*s
... it needs to be 'int'. Detected by Coverity CID 1486611 (etc) Closes #7326
This commit is contained in:
parent
d696ee00ee
commit
78fc6522c2
|
@ -146,7 +146,8 @@ CURLcode Curl_output_digest(struct Curl_easy *data,
|
||||||
tmp = strchr((char *)uripath, '?');
|
tmp = strchr((char *)uripath, '?');
|
||||||
if(tmp) {
|
if(tmp) {
|
||||||
size_t urilen = tmp - (char *)uripath;
|
size_t urilen = tmp - (char *)uripath;
|
||||||
path = (unsigned char *) aprintf("%.*s", urilen, uripath);
|
/* typecast is fine here since the value is always less than 32 bits */
|
||||||
|
path = (unsigned char *) aprintf("%.*s", (int)urilen, uripath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!tmp)
|
if(!tmp)
|
||||||
|
|
|
@ -3873,7 +3873,7 @@ static CURLcode servercert(struct Curl_easy *data,
|
||||||
|
|
||||||
ASN1_TIME_print(mem, X509_get0_notAfter(backend->server_cert));
|
ASN1_TIME_print(mem, X509_get0_notAfter(backend->server_cert));
|
||||||
len = BIO_get_mem_data(mem, (char **) &ptr);
|
len = BIO_get_mem_data(mem, (char **) &ptr);
|
||||||
infof(data, " expire date: %.*s\n", len, ptr);
|
infof(data, " expire date: %.*s\n", (int)len, ptr);
|
||||||
(void)BIO_reset(mem);
|
(void)BIO_reset(mem);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -518,7 +518,7 @@ static const char *GTime2str(const char *beg, const char *end)
|
||||||
beg, beg + 4, beg + 6,
|
beg, beg + 4, beg + 6,
|
||||||
beg + 8, beg + 10, sec1, sec2,
|
beg + 8, beg + 10, sec1, sec2,
|
||||||
fracl? ".": "", fracl, fracp,
|
fracl? ".": "", fracl, fracp,
|
||||||
sep, tzl, tzp);
|
sep, (int)tzl, tzp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -558,7 +558,7 @@ static const char *UTime2str(const char *beg, const char *end)
|
||||||
return curl_maprintf("%u%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s",
|
return curl_maprintf("%u%.2s-%.2s-%.2s %.2s:%.2s:%.2s %.*s",
|
||||||
20 - (*beg >= '5'), beg, beg + 2, beg + 4,
|
20 - (*beg >= '5'), beg, beg + 2, beg + 4,
|
||||||
beg + 6, beg + 8, sec,
|
beg + 6, beg + 8, sec,
|
||||||
tzl, tzp);
|
(int)tzl, tzp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue