ssnail

crappy and opinionated static site generator
git clone https://git.e1e0.net/ssnail.git
Log | Files | Refs | README | LICENSE

commit 112a422351cd514eec59325483112edc737f43b6
parent 75a937005220875ebfd07a5112d2032c191d2d47
Author: Paco Esteban <paco@e1e0.net>
Date:   Mon, 22 Jun 2020 19:32:16 +0200

handle error on strftime

Diffstat:
Mssnail.c | 5++++-
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");