]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
*/: s/DAY_TO_STR/day_to_str_a/
authorAlejandro Colomar <alx@kernel.org>
Fri, 31 Oct 2025 10:01:53 +0000 (11:01 +0100)
committerSerge Hallyn <serge@hallyn.com>
Fri, 28 Nov 2025 02:50:48 +0000 (20:50 -0600)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/time/day_to_str.h
src/chage.c
src/passwd.c
src/usermod.c

index d1817b5a1e7f9b00cfe8283ca3e89cf9ee1b7907..f2f75d6e877fcc034e36b0724a93a2fb35954eaa 100644 (file)
 #include "string/strcpy/strtcpy.h"
 
 
-#define DAY_TO_STR(str, day)   day_to_str(countof(str), str, day)
+// day_to_str_a - day-since-Epoch to string array
+#define day_to_str_a(str, day)  day_to_str(countof(str), str, day)
 
 
 inline void day_to_str(size_t size, char buf[size], long day);
 
 
+// dat_to_str - day-since-Epoch to string
 inline void
 day_to_str(size_t size, char buf[size], long day)
 {
index 06b6600f8c64d3e843ad9edc3667a1ffb8f43b73..9855303f593ca409d817226fb84623e308dba06e 100644 (file)
@@ -184,7 +184,7 @@ static int new_fields (void)
        if (-1 == lstchgdate || lstchgdate > LONG_MAX / DAY)
                strcpy(buf, "-1");
        else
-               DAY_TO_STR(buf, lstchgdate);
+               day_to_str_a(buf, lstchgdate);
 
        change_field (buf, sizeof buf, _("Last Password Change (YYYY-MM-DD)"));
 
@@ -210,7 +210,7 @@ static int new_fields (void)
        if (-1 == expdate || LONG_MAX / DAY < expdate)
                strcpy(buf, "-1");
        else
-               DAY_TO_STR(buf, expdate);
+               day_to_str_a(buf, expdate);
 
        change_field (buf, sizeof buf,
                      _("Account Expiration Date (YYYY-MM-DD)"));
index 336af7dfea0ffab977b2dd4531a2b0aab18f4d96..338b4b85ae68207ca657c7f28e21475c66e86fbd 100644 (file)
@@ -466,7 +466,7 @@ static void print_status (const struct passwd *pw)
 
        sp = prefix_getspnam (pw->pw_name); /* local, no need for xprefix_getspnam */
        if (NULL != sp) {
-               DAY_TO_STR(date, sp->sp_lstchg);
+               day_to_str_a(date, sp->sp_lstchg);
                (void) printf ("%s %s %s %ld %ld %ld %ld\n",
                               pw->pw_name,
                               pw_status (sp->sp_pwdp),
index b3e4c0561cdef7b7be6d979ede513f6344664e86..938941c6205746a4c9ef0cd87c5192cd79ae6aeb 100644 (file)
@@ -600,8 +600,8 @@ static void new_spent (struct spwd *spent, bool process_selinux)
                /* log dates rather than numbers of days. */
                char new_exp[16], old_exp[16];
 
-               DAY_TO_STR(new_exp, user_newexpire);
-               DAY_TO_STR(old_exp, user_expire);
+               day_to_str_a(new_exp, user_newexpire);
+               day_to_str_a(old_exp, user_expire);
 #ifdef WITH_AUDIT
                audit_logger (AUDIT_USER_MGMT,
                              "changing-expiration-date",