lib: parse numbers with fixed known base 10

... instead of using 0 argument that allows decimal, hex or octal when
the number is documented and assumed to use base 10.

Closes #9933
This commit is contained in:
Daniel Stenberg 2022-11-17 08:41:44 +01:00
parent 0fef73ea4a
commit e9c580de4e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
7 changed files with 11 additions and 10 deletions

View file

@ -502,7 +502,7 @@ static ParameterError GetSizeParameter(struct GlobalConfig *global,
char *unit;
curl_off_t value;
if(curlx_strtoofft(arg, &unit, 0, &value)) {
if(curlx_strtoofft(arg, &unit, 10, &value)) {
warnf(global, "invalid number specified for %s\n", which);
return PARAM_BAD_USE;
}

View file

@ -473,7 +473,7 @@ ParameterError str2offset(curl_off_t *val, const char *str)
#if(SIZEOF_CURL_OFF_T > SIZEOF_LONG)
{
CURLofft offt = curlx_strtoofft(str, &endptr, 0, val);
CURLofft offt = curlx_strtoofft(str, &endptr, 10, val);
if(CURL_OFFT_FLOW == offt)
return PARAM_NUMBER_TOO_LARGE;
else if(CURL_OFFT_INVAL == offt)