diff options
Diffstat (limited to 'template.c')
-rw-r--r-- | template.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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; } |