diff options
Diffstat (limited to 'src/clog.c')
-rw-r--r-- | src/clog.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -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: ; |