mirror of
https://github.com/curl/curl.git
synced 2026-04-14 21:41:41 +03:00
tool_getparam: avoid redundant condition in set_rate
When the number parsing fails, the pointer is never moved so there's no point in checking that. Pointed out by CodeSonar Closes #16895
This commit is contained in:
parent
50c1e62fa4
commit
49a87e93c3
1 changed files with 2 additions and 9 deletions
|
|
@ -992,17 +992,10 @@ static ParameterError set_rate(struct GlobalConfig *global,
|
|||
|
||||
if(div) {
|
||||
curl_off_t numunits;
|
||||
const char *s;
|
||||
div++;
|
||||
s = div;
|
||||
|
||||
if(curlx_str_number(&div, &numunits, CURL_OFF_T_MAX)) {
|
||||
if(s == div)
|
||||
/* if div did not move, accept it as a 1 */
|
||||
numunits = 1;
|
||||
else
|
||||
return PARAM_BAD_USE;
|
||||
}
|
||||
if(curlx_str_number(&div, &numunits, CURL_OFF_T_MAX))
|
||||
numunits = 1;
|
||||
|
||||
switch(*div) {
|
||||
case 's': /* per second */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue