* libmisc/getlong.c: Reset errno before calling strtol().
Otherwise, errno could be already set to ERANGE.
This commit is contained in:
@@ -39,6 +39,7 @@ int getlong(const char *numstr, long int *result)
|
||||
long val;
|
||||
char *endptr;
|
||||
|
||||
errno = 0;
|
||||
val = strtol (numstr, &endptr, 10);
|
||||
if (('\0' != *endptr) || (ERANGE == errno)) {
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user