1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmpolld: zero errno in before strtoul call

Testing errno value without explicitly setting to
zero in before the strtoul call may lead to
unexpected failures.
This commit is contained in:
Ondrej Kozina 2015-05-26 15:55:16 +02:00
parent a72a805896
commit c069aff21b

View File

@ -749,6 +749,7 @@ static int process_timeout_arg(const char *str, unsigned *max_timeouts)
char *endptr;
unsigned long l;
errno = 0;
l = strtoul(str, &endptr, 10);
if (errno || *endptr || l >= UINT_MAX)
return 0;