sws: comparison of unsigned expression < 0 is always false

Follow-up to 356dd0b73a

Closes #10903
This commit is contained in:
Daniel Stenberg 2023-04-06 23:55:00 +02:00
parent 4838863d27
commit 3de6b6cfe5
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -2069,9 +2069,9 @@ int main(int argc, char *argv[])
char *endptr;
unsigned long ulnum = strtoul(argv[arg], &endptr, 10);
if((endptr != argv[arg] + strlen(argv[arg])) ||
(ulnum && ((ulnum < 0UL) || (ulnum > 65535UL)))) {
(ulnum && (ulnum > 65535UL))) {
fprintf(stderr, "sws: invalid --keepalive argument (%s), must "
"be number of seconds\n", argv[arg]);
"be number of seconds\n", argv[arg]);
return 0;
}
keepalive_secs = curlx_ultous(ulnum);