* 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.
This commit is contained in:
parent
3a03794bb6
commit
ba7dde0168
@ -1,3 +1,11 @@
|
|||||||
|
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* 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 <nicolas.francois@centraliens.net>
|
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/login.c: Ignore the return value of signal().
|
* src/login.c: Ignore the return value of signal().
|
||||||
|
@ -96,7 +96,7 @@ static void print_one (const struct faillog *fl, uid_t uid)
|
|||||||
once = true;
|
once = true;
|
||||||
}
|
}
|
||||||
pwent = getpwuid (uid); /* local, no need for xgetpwuid */
|
pwent = getpwuid (uid); /* local, no need for xgetpwuid */
|
||||||
time (&now);
|
(void) time (&now);
|
||||||
tm = localtime (&fl->fail_time);
|
tm = localtime (&fl->fail_time);
|
||||||
#ifdef HAVE_STRFTIME
|
#ifdef HAVE_STRFTIME
|
||||||
strftime (ptime, sizeof (ptime), "%D %H:%M:%S %z", tm);
|
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 (0 != fl->fail_locktime) {
|
||||||
if ( ((fl->fail_time+fl->fail_locktime) > now)
|
if ( ((fl->fail_time+fl->fail_locktime) > now)
|
||||||
&& (0 != fl->fail_cnt)) {
|
&& (0 != fl->fail_cnt)) {
|
||||||
printf (_(" [%lds left]"),
|
printf (_(" [%lus left]"),
|
||||||
fl->fail_time +
|
(unsigned long) fl->fail_time + fl->fail_locktime - now);
|
||||||
fl->fail_locktime - now);
|
|
||||||
} else {
|
} else {
|
||||||
printf (_(" [%lds lock]"),
|
printf (_(" [%lds lock]"),
|
||||||
fl->fail_locktime);
|
fl->fail_locktime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -373,7 +372,7 @@ int main (int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
days = atoi (optarg);
|
days = atoi (optarg);
|
||||||
seconds = days * DAY;
|
seconds = (time_t) days * DAY;
|
||||||
tflg = true;
|
tflg = true;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user