]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: check localtime() result
authorKarel Zak <kzak@redhat.com>
Mon, 6 Feb 2012 15:02:28 +0000 (16:02 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Feb 2012 15:02:28 +0000 (16:02 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/agetty.c

index ffdfb31c7d6005155bcd04ae4c56a3e271a3f747..d9c9b05b31f1a48b08dabaec8f94d9bd5306f6ac 100644 (file)
@@ -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),