From: Alejandro Colomar Date: Tue, 14 Oct 2025 11:03:24 +0000 (+0200) Subject: */: s/STRFTIME/strftime_a/ X-Git-Tag: 4.19.0-rc1~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1c685b5ff99ffe3e074022fa26252da341177b0;p=thirdparty%2Fshadow.git */: s/STRFTIME/strftime_a/ This name better reflects that it handles arrays, and doesn't shout. Signed-off-by: Alejandro Colomar --- diff --git a/lib/failure.c b/lib/failure.c index 924c19259..369b215ab 100644 --- a/lib/failure.c +++ b/lib/failure.c @@ -252,7 +252,7 @@ void failprint (const struct faillog *fail) /* * Print all information we have. */ - STRFTIME(lasttimeb, "%c", tp); + strftime_a(lasttimeb, "%c", tp); /*@-formatconst@*/ (void) printf (ngettext ("%d failure since last login.\n" diff --git a/lib/string/README b/lib/string/README index 91355ed27..b946c8b3c 100644 --- a/lib/string/README +++ b/lib/string/README @@ -279,5 +279,5 @@ strsep/ - String separation (But the strings themselves are not duplicated.) strftime.h - STRFTIME() + strftime_a() Like strftime(3), but takes an array. diff --git a/lib/string/strftime.h b/lib/string/strftime.h index c06eb5c67..0c816d535 100644 --- a/lib/string/strftime.h +++ b/lib/string/strftime.h @@ -13,8 +13,8 @@ #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 diff --git a/src/chage.c b/src/chage.c index f2500736f..06b6600f8 100644 --- a/src/chage.c +++ b/src/chage.c @@ -249,7 +249,7 @@ print_day_as_date(long day) 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; } diff --git a/src/faillog.c b/src/faillog.c index f1a0dd1c6..6bb93ae12 100644 --- a/src/faillog.c +++ b/src/faillog.c @@ -173,7 +173,7 @@ static void print_one (/*@null@*/const struct passwd *pw, bool force) 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 ", diff --git a/src/lastlog.c b/src/lastlog.c index dbdd85930..46ccc165e 100644 --- a/src/lastlog.c +++ b/src/lastlog.c @@ -158,7 +158,7 @@ static void print_one (/*@null@*/const struct passwd *pw) 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) { diff --git a/src/login.c b/src/login.c index 2fa940748..4ccbc1224 100644 --- a/src/login.c +++ b/src/login.c @@ -1197,7 +1197,7 @@ int main (int argc, char **argv) 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 */