Skip to content

Commit

Permalink
Check return value of localtime
Browse files Browse the repository at this point in the history
Fixes #10
  • Loading branch information
ailin-nemui committed Jun 29, 2017
1 parent 2b20934 commit 29ebac9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 29ebac9

Please sign in to comment.