diff options
author | Nei <ailin.nemui@gmail.com> | 2017-06-29 13:48:44 +0000 |
---|---|---|
committer | Nei <ailin.nemui@gmail.com> | 2017-06-29 13:48:44 +0000 |
commit | 29ebac987da1da2c892aed5ed329256b7bc94bca (patch) | |
tree | 4667ad8746041b05021489732eb4d5de34083409 /src | |
parent | 2b209348bd2a90afbe1782b0b321d99892b7002b (diff) | |
download | irssi-29ebac987da1da2c892aed5ed329256b7bc94bca.zip |
Check return value of localtime
Fixes #10
Diffstat (limited to 'src')
-rw-r--r-- | src/core/misc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/misc.c b/src/core/misc.c index ce49925b..0b2d8e77 100644 --- a/src/core/misc.c +++ b/src/core/misc.c @@ -560,6 +560,9 @@ char *my_asctime(time_t t) int len; tm = localtime(&t); + if (tm == NULL) + return g_strdup("???"); + str = g_strdup(asctime(tm)); len = strlen(str); |