From d1a1990c4177653fd2379c227142e6208ecfc20d Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Wed, 4 Sep 2019 20:29:20 -0400 Subject: Fix typos in headers --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 043aca3..28bf1b5 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,7 @@ For example: *output* Output: Hello, world! + Length: 13 ### Variable substitution @@ -168,7 +169,9 @@ For example: *main.c* - #include + #include + #include + #include int main(){ /* @@ -185,11 +188,13 @@ For example: } fseek(fp,0,SEEK_END); size_t file_len = ftell(fp); + fseek(fp,0,SEEK_SET); char template[file_len]; fread(template,sizeof(char),file_len,fp); struct TMPL_templates* t; struct TMPL_varlist* vl; + size_t dummy; /* Render the template without a variable named "varname" @@ -201,9 +206,8 @@ For example: */ t = TMPL_alloc_template(template); vl = TMPL_alloc_varlist(); - size_t dummy; char* without_variable = TMPL_render(t,vl,&dummy); - printf("Without variable: %s\n",without_variable); + printf("Without variable:\n%s\n",without_variable); TMPL_free_template(t); TMPL_free_varlist(vl); @@ -215,9 +219,8 @@ For example: t = TMPL_alloc_template(template); vl = TMPL_alloc_varlist(); TMPL_add_var_to_varlist(vl,"varname","Hello, world!"); - size_t dummy; char* with_variable = TMPL_render(t,vl,&dummy); - printf("With variable:%s\n",with_variable); + printf("With variable:\n%s\n",with_variable); TMPL_free_template(t); TMPL_free_varlist(vl); @@ -229,7 +232,6 @@ For example: Without variable: Value is:optional default - With variable: Value is:Hello, world! @@ -252,7 +254,7 @@ If and elseif statements check if strings are the same. They do a strcmp(), so b #include #include - #include + #include int main(){ /* @@ -342,7 +344,7 @@ only variables that have been added to the namespace are accessible in the loop. #include #include - #include + #include int main(){ /* -- cgit v1.2.3-70-g09d2