aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2019-11-25 21:22:30 -0500
committerAlexander Pickering <alexandermpickering@gmail.com>2019-11-25 21:22:30 -0500
commiteaa22550d5f4c7dfbd4e7cdfec9559feff92b9e8 (patch)
tree112a82a19bc4d0bc09c2153b748a2bafb73f3d87 /src
parentb78c973a94702f26d2ed3e6ddfe7061e62783b6f (diff)
downloadlibctemplates-eaa22550d5f4c7dfbd4e7cdfec9559feff92b9e8.tar.gz
libctemplates-eaa22550d5f4c7dfbd4e7cdfec9559feff92b9e8.tar.bz2
libctemplates-eaa22550d5f4c7dfbd4e7cdfec9559feff92b9e8.zip
Added appropriate error for missing a var binding
The var binding warning before was just a printf(), change it so that it outputs some helpful text to the template's errout.
Diffstat (limited to 'src')
-rw-r--r--src/ctemplates.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ctemplates.c b/src/ctemplates.c
index ae2ed2a..3209bf4 100644
--- a/src/ctemplates.c
+++ b/src/ctemplates.c
@@ -987,8 +987,10 @@ render_variable(struct TMPL_templates* t, struct TMPL_varlist* varlist){
if(t->cursor->TMPL_tag.var.defaultval != NULL){
bputs(t->out,t->cursor->TMPL_tag.var.defaultval);
}else{
- printf("Variable not bound, and no default\n");
/*Error, not bound and no default*/
+ bputs(t->errout,"Render error: Variable \"");
+ bputs(t->errout,varname);
+ bputs(t->errout,"\" was not bound to a value, and has no default\n");
return -1;
}
}else{