aboutsummaryrefslogtreecommitdiff
path: root/src/clog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/clog.c')
-rw-r--r--src/clog.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/clog.c b/src/clog.c
index 24e08d0..2705558 100644
--- a/src/clog.c
+++ b/src/clog.c
@@ -184,7 +184,9 @@ int get_entry_form(struct http_request *req) {
int post_entry_form(struct http_request *req) {
- struct kore_buf *resp_buf = kore_buf_alloc(0);
+ int err = 0;
+
+ struct kore_buf *resp_buf = NULL;
char *id = NULL;
char *title = NULL;
@@ -204,6 +206,8 @@ int post_entry_form(struct http_request *req) {
kore_log(LOG_INFO, "form body %s.", body);
}
+ resp_buf = kore_buf_alloc(0);
+
// Append form.
kore_buf_appendf(
resp_buf, (const char *) asset_entry_edit_html,
@@ -211,11 +215,11 @@ int post_entry_form(struct http_request *req) {
);
// Render MD.
- (void) render_md(body, resp_buf);
- // if (err == KORE_RESULT_ERROR) {
- // kore_log(LOG_ERR, "Error rendering markdown for entry %s.", id);
- // continue;
- // }
+ err = render_md(body, resp_buf);
+ if (err == KORE_RESULT_ERROR) {
+ kore_buf_append(resp_buf, "Error rendering markdown.", 25);
+ kore_log(LOG_ERR, "Error rendering markdown.");
+ }
http_ok_resp(req, HTTP_STATUS_OK, resp_buf);