diff options
author | Michael McVady <femtonaut@gmail.com> | 2024-01-13 14:24:03 -0600 |
---|---|---|
committer | Michael McVady <femtonaut@gmail.com> | 2024-01-13 14:24:03 -0600 |
commit | 5a3489865fa7efe40eaa59a4ca865387b25f0d35 (patch) | |
tree | c5f99ab56b5d27da93e8df1a6b5c8fb8ae9b7ba3 | |
parent | 5830cf2890bc01efa16f76c971408a8ffd76bd1d (diff) |
lint whitespace
-rw-r--r-- | assets/search.html | 2 | ||||
-rw-r--r-- | src/clog.c | 24 | ||||
-rw-r--r-- | src/init.c | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/assets/search.html b/assets/search.html index 8b319e0..28a93c3 100644 --- a/assets/search.html +++ b/assets/search.html @@ -1,4 +1,4 @@ -<form> +<form> <input type="search" id="query" name="query" placeholder="Search..."> <button>Search</button> </form> @@ -83,7 +83,7 @@ void entry_query_init(struct entry_query *eq, const char *id, const char *query) if (id != NULL) { eq->id = kore_strdup(id); - } + } else { eq->id = NULL; } @@ -96,7 +96,7 @@ void entry_query_init(struct entry_query *eq, const char *id, const char *query) eq->query[i] = '|'; } } - } + } else { eq->query = NULL; } @@ -115,7 +115,7 @@ void entry_query_cleanup(struct entry_query *eq) { kore_free((void *) eq->id); } eq->id = NULL; - + if (eq->query != NULL) { kore_free((void *) eq->query); } @@ -247,11 +247,11 @@ int get_index(struct http_request *req) { // Write table footer. kore_buf_append(content, asset_table_footer_html, asset_len_table_footer_html); - + http_ok_resp(req, HTTP_STATUS_OK, content); - + out: ; - + kore_free(content); entry_query_cleanup(&eq); @@ -309,7 +309,7 @@ int get_entry(struct http_request *req) { out: ; entry_query_cleanup(&eq); - + kore_free(rendered_body); kore_free(content); @@ -330,7 +330,7 @@ int edit_entry(struct http_request *req) { id = kore_strdup(req->path + strlen("/entries/")); id[strlen(id) - strlen("/edit")] = '\0'; - + entry_query_init(&eq, (const char*) id, NULL); // Check for valid resource UUID @@ -390,7 +390,7 @@ int update_entry(struct http_request *req) { char *id = NULL; char *title = NULL; char *body = NULL; - + http_populate_post(req); if (http_argument_get_string(req, "title", &title)) { @@ -493,11 +493,11 @@ int search_entries(struct http_request *req) { } http_ok_resp(req, HTTP_STATUS_OK, content); - + out: ; entry_query_cleanup(&eq); - + kore_free(content); return KORE_RESULT_OK; @@ -645,7 +645,7 @@ static int render_md(const char *in, struct kore_buf *out) { static unsigned parser_flags = 0; static unsigned renderer_flags = 0; - + parser_flags |= MD_FLAG_TABLES; parser_flags |= MD_FLAG_STRIKETHROUGH; // parser_flags |= MD_FLAG_TASKLISTS; @@ -56,7 +56,7 @@ int init_db(void) { env = getenv("POSTGRES_PASSWORD"); if (env) kore_buf_appendf(pg_config_buf, "password=%s ", env); - + env = getenv("POSTGRES_DB"); if (env) kore_buf_appendf(pg_config_buf, "dbname=%s ", env); |