From: Daniel Stenberg Date: Tue, 1 Apr 2025 08:25:41 +0000 (+0200) Subject: tool_getparam: avoid redundant condition in set_rate X-Git-Tag: curl-8_13_0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49a87e93c3476ffb168f2ebe6918c31ef023fd9e;p=thirdparty%2Fcurl.git 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 --- diff --git a/src/tool_getparam.c b/src/tool_getparam.c index e5272de74f..a55973a60a 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -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 */