summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNei <ailin.nemui@gmail.com>2017-06-29 13:48:44 +0000
committerNei <ailin.nemui@gmail.com>2017-06-29 13:48:44 +0000
commit29ebac987da1da2c892aed5ed329256b7bc94bca (patch)
tree4667ad8746041b05021489732eb4d5de34083409
parent2b209348bd2a90afbe1782b0b321d99892b7002b (diff)
downloadirssi-29ebac987da1da2c892aed5ed329256b7bc94bca.zip
Check return value of localtime
Fixes #10
-rw-r--r--src/core/misc.c3
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);