summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/time/ctime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/time/ctime.c b/src/time/ctime.c
index 185ec554..36029315 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);
}