From: nekral-guest Date: Fri, 13 Jun 2008 21:28:11 +0000 (+0000) Subject: * src/faillog.c: Ignore return value of time() when use with a X-Git-Tag: 4.1.3~365 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba7dde01680abf0da5bc1946510fd88bc55d0ad1;p=shadow * src/faillog.c: Ignore return value of time() when use with a non NULL argument. * src/faillog.c: Use a %lu format and cast number of days to unsigned long integers. * src/faillog.c: Cast dates to time_t. --- diff --git a/ChangeLog b/ChangeLog index 095d39ea..2b335692 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-06-13 Nicolas François + + * src/faillog.c: Ignore return value of time() when use with a + non NULL argument. + * src/faillog.c: Use a %lu format and cast number of days to + unsigned long integers. + * src/faillog.c: Cast dates to time_t. + 2008-06-13 Nicolas François * src/login.c: Ignore the return value of signal(). diff --git a/src/faillog.c b/src/faillog.c index 59e8b604..2501b029 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -96,7 +96,7 @@ static void print_one (const struct faillog *fl, uid_t uid) once = true; } pwent = getpwuid (uid); /* local, no need for xgetpwuid */ - time (&now); + (void) time (&now); tm = localtime (&fl->fail_time); #ifdef HAVE_STRFTIME strftime (ptime, sizeof (ptime), "%D %H:%M:%S %z", tm); @@ -111,12 +111,11 @@ static void print_one (const struct faillog *fl, uid_t uid) if (0 != fl->fail_locktime) { if ( ((fl->fail_time+fl->fail_locktime) > now) && (0 != fl->fail_cnt)) { - printf (_(" [%lds left]"), - fl->fail_time + - fl->fail_locktime - now); + printf (_(" [%lus left]"), + (unsigned long) fl->fail_time + fl->fail_locktime - now); } else { printf (_(" [%lds lock]"), - fl->fail_locktime); + fl->fail_locktime); } } } @@ -373,7 +372,7 @@ int main (int argc, char **argv) break; case 't': days = atoi (optarg); - seconds = days * DAY; + seconds = (time_t) days * DAY; tflg = true; break; case 'u':