X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Ftime%2Fctime.c;h=36029315128f250a86264447ee20a95bd7f366b7;hb=5c10c33d2a35204ee76931625a007fcc8cca3228;hp=185ec5543b958e04ff7560ae333ed7cac61a9c2c;hpb=1c86c7f5c26dd0569df7afc23ee9866fb3f645dc;p=musl 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); }