aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/clog.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/clog.c b/src/clog.c
index 83f9f79..5c0037f 100644
--- a/src/clog.c
+++ b/src/clog.c
@@ -279,8 +279,6 @@ render_posts_json(struct post_request *post_req)
{
int err = 0;
- int rows = 0;
-
const char *json = NULL;
struct kore_pgsql sql;
@@ -328,20 +326,19 @@ render_posts_json(struct post_request *post_req)
goto out;
}
+ // XXX Always tuples from the above Postgres queries, need to check the length for results.
if (kore_pgsql_getlength(&sql, 0, 0) == 0)
{
post_req->resp_status = HTTP_STATUS_NOT_FOUND;
goto out;
}
- if (rows == 1) {
- json = kore_pgsql_getvalue(&sql, 0, 0);
- kore_buf_append(
- post_req->resp_buf,
- json,
- strlen(json)
- );
- }
+ json = kore_pgsql_getvalue(&sql, 0, 0);
+ kore_buf_append(
+ post_req->resp_buf,
+ json,
+ strlen(json)
+ );
out: ;