This name better reflects that it handles arrays, and doesn't shout.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
/*
* Print all information we have.
*/
- STRFTIME(lasttimeb, "%c", tp);
+ strftime_a(lasttimeb, "%c", tp);
/*@-formatconst@*/
(void) printf (ngettext ("%d failure since last login.\n"
(But the strings themselves are not duplicated.)
strftime.h
- STRFTIME()
+ strftime_a()
Like strftime(3), but takes an array.
#include "sizeof.h"
-// string format time
-#define STRFTIME(dst, fmt, tm) strftime(dst, countof(dst), fmt, tm)
+// strftime_a - string format time array
+#define strftime_a(dst, fmt, tm) strftime(dst, countof(dst), fmt, tm)
#endif // include guard
return;
}
- if (STRFTIME(buf, iflg ? "%F" : "%b %d, %Y", &tm) == 0) {
+ if (strftime_a(buf, iflg ? "%F" : "%b %d, %Y", &tm) == 0) {
puts(_("future"));
return;
}
fprintf (stderr, "Cannot read time from faillog.\n");
return;
}
- STRFTIME(ptime, "%D %H:%M:%S %z", tm);
+ strftime_a(ptime, "%D %H:%M:%S %z", tm);
cp = ptime;
printf ("%-9s %5d %5d ",
if (tm == NULL) {
cp = "(unknown)";
} else {
- STRFTIME(ptime, "%a %b %e %H:%M:%S %z %Y", tm);
+ strftime_a(ptime, "%a %b %e %H:%M:%S %z %Y", tm);
cp = ptime;
}
if (ll.ll_time == (time_t) 0) {
struct tm tm;
localtime_r(&ll_time, &tm);
- STRFTIME(ptime, "%a %b %e %H:%M:%S %z %Y", &tm);
+ strftime_a(ptime, "%a %b %e %H:%M:%S %z %Y", &tm);
printf (_("Last login: %s on %s"),
ptime, ll.ll_line);
#ifdef HAVE_LL_HOST /* __linux__ || SUN4 */