diff --git a/stagit-index.c b/stagit-index.c index e2cac59..5875d21 100644 --- a/stagit-index.c +++ b/stagit-index.c @@ -49,7 +49,8 @@ printtimeformat(FILE *fp, const git_time *intime, const char *fmt) char out[32]; t = (time_t) intime->time + (intime->offset * 60); - intm = gmtime(&t); + if (!(intm = gmtime(&t))) + return; strftime(out, sizeof(out), fmt, intm); fputs(out, fp); } diff --git a/stagit.c b/stagit.c index cbb0a77..e4e4cfe 100644 --- a/stagit.c +++ b/stagit.c @@ -190,7 +190,8 @@ printtimeformat(FILE *fp, const git_time *intime, const char *fmt) char out[32]; t = (time_t) intime->time + (intime->offset * 60); - intm = gmtime(&t); + if (!(intm = gmtime(&t))) + return; strftime(out, sizeof(out), fmt, intm); fputs(out, fp); }