From a1cac18ac3dd413835a9c4b2c780f3abb48dd838 Mon Sep 17 00:00:00 2001 From: nekral-guest Date: Sun, 5 Apr 2009 22:02:50 +0000 Subject: [PATCH] * src/useradd.c: Set errno to 0 before calling strtol. --- ChangeLog | 4 ++++ src/useradd.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index aa72d20f..e3536db2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-05 Nicolas François + + * src/useradd.c: Set errno to 0 before calling strtol. + 2009-04-05 Nicolas François * libmisc/isexpired.c: If there are no shadow entry, there is no diff --git a/src/useradd.c b/src/useradd.c index 8ae84249..e90108ed 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -286,6 +286,7 @@ static long get_number (const char *numstr) long val; char *endptr; + errno = 0; val = strtol (numstr, &endptr, 10); if (('\0' == *numstr) || ('\0' != *endptr) || (ERANGE == errno)) { fprintf (stderr,