Fix segfault when time is unreadable
Adding myself to contributors Closes #130
This commit is contained in:
parent
b2753b146a
commit
c667083c81
1
README
1
README
@ -59,6 +59,7 @@ Dave Hagewood <admin@arrowweb.com>
|
||||
David A. Holland <dholland@hcs.harvard.edu>
|
||||
David Frey <David.Frey@lugs.ch>
|
||||
Ed Carp <ecarp@netcom.com>
|
||||
Ed Neville <ed@s5h.net>
|
||||
Eric W. Biederman" <ebiederm@xmission.com>
|
||||
Floody <flood@evcom.net>
|
||||
Frank Denis <j@4u.net>
|
||||
|
@ -163,6 +163,10 @@ static void print_one (/*@null@*/const struct passwd *pw, bool force)
|
||||
}
|
||||
|
||||
tm = localtime (&fl.fail_time);
|
||||
if (!tm) {
|
||||
fprintf (stderr, "Cannot read time from faillog.\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
#ifdef HAVE_STRFTIME
|
||||
strftime (ptime, sizeof (ptime), "%D %H:%M:%S %z", tm);
|
||||
cp = ptime;
|
||||
|
Loading…
Reference in New Issue
Block a user