mirror of
https://github.com/curl/curl.git
synced 2026-05-06 02:27:32 +03:00
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:
parent
0fef73ea4a
commit
e9c580de4e
7 changed files with 11 additions and 10 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue