if (path[7] == 0) { /* No username */
const char *clear = cgi_getentrystr("clear");
- if (strncmp(clear, "feed", 4) == 0) {
+ if (clear != NULL) {
struct blerg *b = blerg_open(username);
- blerg_set_subscription_mark(b);
- blerg_close(b);
- respond_JSON_Success();
- } else if (strncmp(clear, "mentioned", 9) == 0) {
- struct blerg *b = blerg_open(username);
- blerg_set_status(b, BLERGSTATUS_MENTIONED, 0);
+ if (strncmp(clear, "feed", 4) == 0) {
+ blerg_set_subscription_mark(b);
+ } else if (strncmp(clear, "mentioned", 9) == 0) {
+ blerg_set_status(b, BLERGSTATUS_MENTIONED, 0);
+ }
blerg_close(b);
respond_JSON_Success();
} else {
int mentioned = blerg_get_status(b, BLERGSTATUS_MENTIONED);
blerg_close(b);
- yajl_gen_string(g, (unsigned char *)"feed_new", 7);
+ yajl_gen_string(g, (unsigned char *)"feed_new", 8);
yajl_gen_integer(g, subscription_count_items(username) - subscription_mark);
yajl_gen_string(g, (unsigned char *)"mentioned", 9);
}
cgi_quit();
+
+ return 0;
}