From: Karel Zak Date: Mon, 6 Feb 2012 15:02:28 +0000 (+0100) Subject: agetty: check localtime() result X-Git-Tag: v2.21-rc2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9201203cff43408228c2e26c051012db9821450;p=thirdparty%2Futil-linux.git agetty: check localtime() result Signed-off-by: Karel Zak --- diff --git a/term-utils/agetty.c b/term-utils/agetty.c index ffdfb31c7d..d9c9b05b31 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),