Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fix a bug in mustach
[src/app-framework-main.git]
/
src
/
mustach.c
diff --git
a/src/mustach.c
b/src/mustach.c
index
19df16f
..
03f3cb1
100644
(file)
--- a/
src/mustach.c
+++ b/
src/mustach.c
@@
-47,7
+47,7
@@
static int getpartial(struct mustach_itf *itf, void *closure, const char *name,
rc = fputc(0, file) ? MUSTACH_ERROR_SYSTEM : 0;
fclose(file);
if (rc < 0) {
rc = fputc(0, file) ? MUSTACH_ERROR_SYSTEM : 0;
fclose(file);
if (rc < 0) {
- free(result);
+ free(
*
result);
*result = NULL;
}
}
*result = NULL;
}
}
@@
-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);
}
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;
if (term == NULL)
return MUSTACH_ERROR_UNEXPECTED_END;
template = term + cllen;
- beg += oplen;
len = (size_t)(term - beg);
c = *beg;
switch(c) {
len = (size_t)(term - beg);
c = *beg;
switch(c) {