#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)
{
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)"));
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)"));
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),
/* 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",