tool_getparam: pass in the snprintf("%.*s") string length as 'int'

Reported by Coverity CID 1515928

Closes #9679
This commit is contained in:
Daniel Stenberg 2022-10-09 23:42:08 +02:00
parent b261389dba
commit 1527dd07f1
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -637,7 +637,7 @@ static ParameterError data_urlencode(struct GlobalConfig *global,
return PARAM_NO_MEM;
}
if(nlen > 0) { /* only append '=' if we have a name */
msnprintf(n, outlen, "%.*s=%s", nlen, nextarg, enc);
msnprintf(n, outlen, "%.*s=%s", (int)nlen, nextarg, enc);
size = outlen-1;
}
else {