From: Alejandro Colomar Date: Fri, 31 Oct 2025 10:01:53 +0000 (+0100) Subject: */: s/DAY_TO_STR/day_to_str_a/ X-Git-Tag: 4.19.0-rc1~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=501f6efe85314a2d6adc41835c1af0460a36b809;p=thirdparty%2Fshadow.git */: s/DAY_TO_STR/day_to_str_a/ Signed-off-by: Alejandro Colomar --- diff --git a/lib/time/day_to_str.h b/lib/time/day_to_str.h index d1817b5a1..f2f75d6e8 100644 --- a/lib/time/day_to_str.h +++ b/lib/time/day_to_str.h @@ -16,12 +16,14 @@ #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) { diff --git a/src/chage.c b/src/chage.c index 06b6600f8..9855303f5 100644 --- a/src/chage.c +++ b/src/chage.c @@ -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)")); diff --git a/src/passwd.c b/src/passwd.c index 336af7dfe..338b4b85a 100644 --- a/src/passwd.c +++ b/src/passwd.c @@ -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), diff --git a/src/usermod.c b/src/usermod.c index b3e4c0561..938941c62 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -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",