tmpl

Simple key-value templator
git clone https://git.sinitax.com/sinitax/tmpl
Log | Files | Refs | README | LICENSE | sfeed.txt

commit fed613ed3d2fb9e60644f829d9df0521b41b319e
parent 6d2f9ef18968724bbcdc08eeaf32951e99f20601
Author: Louis Burda <quent.burda@gmail.com>
Date:   Wed,  2 Aug 2023 23:34:01 +0200

Fix empty line check in perline

Diffstat:
Mtmpl.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tmpl.c b/tmpl.c @@ -194,7 +194,7 @@ perline(const char *path, int nonempty, void (*process)(char *)) while (fgets(linebuf, 4096, f)) { len = strlen(linebuf); if (len && linebuf[len - 1] == '\n') { - linebuf[len - 1] = '\0'; + linebuf[--len] = '\0'; } else if (len && !feof(f)) { die("fgets '%s': line too long", path); }