* src/useradd.c: Set errno to 0 before calling strtol.

This commit is contained in:
nekral-guest 2009-04-05 22:02:50 +00:00
parent 2a3b84b888
commit a1cac18ac3
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2009-04-05 Nicolas François <nicolas.francois@centraliens.net>
* src/useradd.c: Set errno to 0 before calling strtol.
2009-04-05 Nicolas François <nicolas.francois@centraliens.net> 2009-04-05 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/isexpired.c: If there are no shadow entry, there is no * libmisc/isexpired.c: If there are no shadow entry, there is no

View File

@ -286,6 +286,7 @@ static long get_number (const char *numstr)
long val; long val;
char *endptr; char *endptr;
errno = 0;
val = strtol (numstr, &endptr, 10); val = strtol (numstr, &endptr, 10);
if (('\0' == *numstr) || ('\0' != *endptr) || (ERANGE == errno)) { if (('\0' == *numstr) || ('\0' != *endptr) || (ERANGE == errno)) {
fprintf (stderr, fprintf (stderr,