From: Alejandro Colomar Date: Sun, 11 Aug 2024 19:42:03 +0000 (+0200) Subject: src/chage.c: print_day_as_date(): Handle errors from strfime(3) X-Git-Tag: 4.17.0-rc1~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60da937c2f2c45a568fe61c208f47810c8fb329e;p=thirdparty%2Fshadow.git 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 --- diff --git a/src/chage.c b/src/chage.c index 95adb593d..f2df8dc76 100644 --- a/src/chage.c +++ b/src/chage.c @@ -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); }