mirror of
https://github.com/curl/curl.git
synced 2026-04-22 08:12:12 +03:00
tool_paramhlp: improve str2num(): avoid unnecessary call to strlen()
Closes #11742
This commit is contained in:
parent
864090ca39
commit
458c70db6a
1 changed files with 1 additions and 1 deletions
|
|
@ -138,7 +138,7 @@ static ParameterError getnum(long *val, const char *str, int base)
|
|||
num = strtol(str, &endptr, base);
|
||||
if(errno == ERANGE)
|
||||
return PARAM_NUMBER_TOO_LARGE;
|
||||
if((endptr != str) && (endptr == str + strlen(str))) {
|
||||
if((endptr != str) && (*endptr == '\0')) {
|
||||
*val = num;
|
||||
return PARAM_OK; /* Ok */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue