diff options
author | Vincent Douillet <vincent@vdouillet.fr> | 2024-09-06 12:21:06 +0200 |
---|---|---|
committer | Vincent Douillet <vincent@vdouillet.fr> | 2024-09-06 12:22:20 +0200 |
commit | d7edafe299d44a0bec9d29e2b3a4ca853ffa1a80 (patch) | |
tree | 9f4de85662fbfd997bf5ee96671a2f776f2c53a6 /template.c | |
parent | 35a145fd161fb4d4f19aa9820b50438695b94414 (diff) |
upload: add form
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; } |