summaryrefslogtreecommitdiff
path: root/stagit.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-04-27 19:24:15 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-04-27 19:24:15 +0200
commit28730218c4b68e9b3a0f7ce628868bb647d97f9e (patch)
tree09f3f1d761ffee463ad053c49436d45a4625ca84 /stagit.c
parent8df54926f2ad80ae46a4cc701f3341e97839e0c8 (diff)
fix: check gmtime, can return NULL on error
Diffstat (limited to 'stagit.c')
-rw-r--r--stagit.c3
1 files changed, 2 insertions, 1 deletions
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);
}