summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index ffdfb31c7..d9c9b05b3 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1819,6 +1819,9 @@ static void output_special_char(unsigned char c, struct options *op,
time(&now);
tm = localtime(&now);
+ if (!tm)
+ break;
+
if (c == 'd') /* ISO 8601 */
printf("%s %s %d %d",
nl_langinfo(ABDAY_1 + tm->tm_wday),