diff --git a/src/time/ctime.c b/src/time/ctime.c index 185ec5543b958e04ff7560ae333ed7cac61a9c2c..36029315128f250a86264447ee20a95bd7f366b7 100644 --- a/src/time/ctime.c +++ b/src/time/ctime.c @@ -2,5 +2,7 @@ char *ctime(const time_t *t) { - return asctime(localtime(t)); + struct tm *tm = localtime(t); + if (!tm) return 0; + return asctime(tm); }