Actually implement /tag in cgi_blerg. Also /create
[blerg.git] / http / http_blerg.c
index b790183..1d272eb 100644 (file)
@@ -131,14 +131,11 @@ ssize_t GET_generate_taglist(void *cls, uint64_t pos, char *buf, size_t max) {
 
        /* Snarf one record */
        b = blerg_open(ts->results[ts->i].author);
-       if (b == NULL)
-               goto skip_bad_blerg;
-
-       json_generate_one_record(ts->g, ts->results[ts->i].author, b, ts->results[ts->i].record);
-
-       blerg_close(b);
+       if (b != NULL) {
+               json_generate_one_record(ts->g, ts->results[ts->i].author, b, ts->results[ts->i].record);
+               blerg_close(b);
+       }
 
-skip_bad_blerg:
        if (ts->i == 0) {
                yajl_gen_array_close(ts->g);
                ts->done = 1;
@@ -318,7 +315,7 @@ ahc_derp (void *cls, struct MHD_Connection *connection, const char *url, const c
                if (!tag_exists(info.author))
                        return respond_404(connection);
 
-               uint64_t recs = 50;
+               int recs = 50;
                struct tag *taglist = tag_list(info.author, 0, &recs, -1);
 
                if (recs == 0) {