| Date: Wed, 27 Apr 2016 19:24:15 +0200
fix: check gmtime, can return NULL on error
Diffstat:
M stagit-index.c | 3 ++-
M stagit.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
--- |
| @@ -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);
} |
| @@ -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);
} |