src/chage.c: print_day_as_date(): Handle errors from strfime(3)

Just like we do in day_to_str().

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar
2024-08-11 21:42:03 +02:00
committed by Serge Hallyn
parent 6a2e298a5b
commit 60da937c2f

View File

@@ -247,7 +247,11 @@ print_day_as_date(long day)
return;
}
STRFTIME(buf, iflg ? "%F" : "%b %d, %Y", &tm);
if (STRFTIME(buf, iflg ? "%F" : "%b %d, %Y", &tm) == 0) {
puts(_("future"));
return;
}
(void) puts (buf);
}