]> source.dussan.org Git - rspamd.git/commitdiff
Json fix.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 18 Aug 2011 13:51:23 +0000 (17:51 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Thu, 18 Aug 2011 13:51:23 +0000 (17:51 +0400)
src/protocol.c

index 811fb2c4c7fae9f3caa6e5d44abae3bbfc1b7bf1..a6da0640cb2e377a4c5c5d1cf4bcd7fde5e4c792 100644 (file)
@@ -873,11 +873,11 @@ metric_symbols_callback_json (gpointer key, gpointer value, void *user_data)
                                (gchar *)key, s->score);
        if (description != NULL) {
                cd->symbols_offset += rspamd_snprintf (cd->symbols_buf + cd->symbols_offset, cd->symbols_size - cd->symbols_offset,
-                               "        \"description\": \"%s\"" CRLF, description);
+                               "        \"description\": \"%s\"%s" CRLF, description, s->options ? "" : ",");
        }
        else {
                cd->symbols_offset += rspamd_snprintf (cd->symbols_buf + cd->symbols_offset, cd->symbols_size - cd->symbols_offset,
-                               "        \"description\": \"\"" CRLF);
+                               "        \"description\": \"\"%s" CRLF, s->options ? "" : ",");
        }
        if (s->options) {
                cd->symbols_offset += rspamd_snprintf (cd->symbols_buf + cd->symbols_offset, cd->symbols_size - cd->symbols_offset,