summaryrefslogtreecommitdiff
path: root/template.c
diff options
context:
space:
mode:
Diffstat (limited to 'template.c')
-rw-r--r--template.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/template.c b/template.c
index 4ac3e9f..a7b2922 100644
--- a/template.c
+++ b/template.c
@@ -117,22 +117,22 @@ page_template_new(const char *page)
page_template_free(tmpl);
return NULL;
}
- /* read page footer */
+ /* read page footer (optional) */
path_size = snprintf(template_path, sizeof(template_path), "%s/%s_%s",
TEMPLATE_DIR, page, "foot.html");
- if (path_size < 0 || path_size >= sizeof(template_path) ||
- read_file(template_path, &tmpl->page_footer, &file_size) < 0) {
+ if (path_size < 0 || path_size >= sizeof(template_path)) {
page_template_free(tmpl);
return NULL;
}
- /* read page item */
+ read_file(template_path, &tmpl->page_footer, &file_size);
+ /* read page item (optional) */
path_size = snprintf(template_path, sizeof(template_path), "%s/%s_%s",
TEMPLATE_DIR, page, "item.html");
- if (path_size < 0 || path_size >= sizeof(template_path) ||
- read_file(template_path, &tmpl->page_item, &file_size) < 0) {
+ if (path_size < 0 || path_size >= sizeof(template_path)) {
page_template_free(tmpl);
return NULL;
}
+ read_file(template_path, &tmpl->page_item, &file_size);
return tmpl;
}