summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-03-02 11:45:17 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-03-02 11:51:21 +0100
commitba9ab1c5bb62fd849423509b918d494888a87a38 (patch)
treee05ca78063826b4d853ac3903a74f841f8ee5597
parentee46ba35b65fe8cea2b1cd754e7c60bf71d3b8ab (diff)
fix a bug in mustach
occured if closing before opening Change-Id: I9c9515535d83f2c13bb75c0638e12c0a5a333413 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/mustach.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mustach.c b/src/mustach.c
index 5bf9f56..03f3cb1 100644
--- a/src/mustach.c
+++ b/src/mustach.c
@@ -76,11 +76,11 @@ static int process(const char *template, struct mustach_itf *itf, void *closure,
}
if (emit)
fwrite(template, (size_t)(beg - template), 1, file);
- term = strstr(template, clstr);
+ beg += oplen;
+ term = strstr(beg, clstr);
if (term == NULL)
return MUSTACH_ERROR_UNEXPECTED_END;
template = term + cllen;
- beg += oplen;
len = (size_t)(term - beg);
c = *beg;
switch(c) {