commit 112a422351cd514eec59325483112edc737f43b6
parent 75a937005220875ebfd07a5112d2032c191d2d47
Author: Paco Esteban <paco@e1e0.net>
Date: Mon, 22 Jun 2020 19:32:16 +0200
handle error on strftime
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ssnail.c b/ssnail.c
@@ -191,7 +191,10 @@ generate_index(struct listhead *h, char *head_tpl,
time(&now);
timeInfo = localtime(&now);
- strftime(mytime, sizeof(mytime), "%Y-%m-%d", timeInfo);
+ if (strftime(mytime, sizeof(mytime), "%Y-%m-%d", timeInfo) == 0) {
+ error = ssnail_error_msg(2, "strftime");
+ goto out;
+ }
if (load_from_file(&header, head_tpl) == 0) {
error = ssnail_error_from_errno("load head_tpl");