]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
*/: s/STRFTIME/strftime_a/
authorAlejandro Colomar <alx@kernel.org>
Tue, 14 Oct 2025 11:03:24 +0000 (13:03 +0200)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Nov 2025 02:50:48 +0000 (20:50 -0600)
This name better reflects that it handles arrays, and doesn't shout.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/failure.c
lib/string/README
lib/string/strftime.h
src/chage.c
src/faillog.c
src/lastlog.c
src/login.c

index 924c1925989f4122cbec14b924091a69ac837327..369b215abcadd646502bf6ee22847958f687ace3 100644 (file)
@@ -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"
index 91355ed2794e8d6c4a24c8155b9a790404b2b60a..b946c8b3cda59990aabe4d4a60818a97ff421095 100644 (file)
@@ -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.
index c06eb5c675c15e979212b017d721ed59a551e6ea..0c816d5352c23c0d07f07fcae71780830db1d43c 100644 (file)
@@ -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
index f2500736f04587bde319d5addf98405c9aa2333c..06b6600f8c64d3e843ad9edc3667a1ffb8f43b73 100644 (file)
@@ -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;
        }
index f1a0dd1c6787695262104faebc3dc23493a04ba3..6bb93ae1256785c7fefa05e10006f67e3f9e9eda 100644 (file)
@@ -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   ",
index dbdd859309b1e3e0b971e2388ce44d95c13e74af..46ccc165e6378792309645cc3cf62d83c174ce16 100644 (file)
@@ -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) {
index 2fa9407484da3f7db86a2696957dcd2a962fc8da..4ccbc1224d026c591c60c238731249b5ebdeefa2 100644 (file)
@@ -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 */