From 160a24738a9821568cb422d69f169f5353d8b22c Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Sun, 12 Jul 2020 11:15:44 -0400 Subject: Clean up page error handling --- contexts.c | 4 ++-- events.c | 4 ++-- networks.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contexts.c b/contexts.c index 39974bb..04b44ac 100644 --- a/contexts.c +++ b/contexts.c @@ -105,8 +105,8 @@ enum kcgi_err pageContexts(struct kreq *req) { || khtml_puts(&html, context) || khtml_closeelem(&html, 2); free(href); - if (error) break; + if (error) return error; } if (result != SQLITE_DONE) errx(EX_SOFTWARE, "%s", sqlite3_errmsg(db)); - return error || htmlFooter(&html) || khtml_close(&html); + return htmlFooter(&html) || khtml_close(&html); } diff --git a/events.c b/events.c index 89da92d..e018087 100644 --- a/events.c +++ b/events.c @@ -180,8 +180,8 @@ enum kcgi_err pageEvents(struct kreq *req) { event.target = sqlite3_column_text(events, i++); event.message = sqlite3_column_text(events, i++); error = htmlEvent(&html, scope, event); - if (error) break; + if (error) return error; } if (result != SQLITE_DONE) errx(EX_SOFTWARE, "%s", sqlite3_errmsg(db)); - return error || htmlFooter(&html) || khtml_close(&html); + return htmlFooter(&html) || khtml_close(&html); } diff --git a/networks.c b/networks.c index ff877d7..289fa31 100644 --- a/networks.c +++ b/networks.c @@ -97,8 +97,8 @@ enum kcgi_err pageNetworks(struct kreq *req) { || khtml_puts(&html, network) || khtml_closeelem(&html, 2); free(href); - if (error) break; + if (error) return error; } if (result != SQLITE_DONE) errx(EX_SOFTWARE, "%s", sqlite3_errmsg(db)); - return error || htmlFooter(&html) || khtml_close(&html); + return htmlFooter(&html) || khtml_close(&html); } -- cgit 1.4.1