Skip to content

Commit a598e0c

Browse files
committed
Evaluate return of strftime.
1 parent ac49e3d commit a598e0c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,11 @@ im_printf(char *str, struct tm *tm,
623623
struct stat st;
624624

625625
ret[0] = '\0';
626-
strftime(strf, 4095, str, tm);
626+
627+
if (strftime(strf, 4095, str, tm) == 0) {
628+
fprintf(stderr, "strftime returned 0\n");
629+
exit(EXIT_FAILURE);
630+
}
627631

628632
for (c = strf; *c != '\0'; c++) {
629633
if (*c == '$') {

0 commit comments

Comments
 (0)