Escape "'s for json output. playerz-1
authorNot Zed <notzed@gmail.com>
Mon, 18 Mar 2024 03:05:03 +0000 (13:35 +1030)
committerNot Zed <notzed@gmail.com>
Mon, 18 Mar 2024 03:05:03 +0000 (13:35 +1030)
http-monitor.c

index de5ebbc..c94defb 100644 (file)
@@ -133,6 +133,9 @@ static void json_print(struct obstack *os, uint8_t *s) {
        while ((c = *s++)) {
                if (c < 32) {
                        obstack_1grow(os, '?');
+               } else if (c == '"') {
+                       obstack_1grow(os, '\\');
+                       obstack_1grow(os, c);
                } else if (c == '\\') {
                        obstack_1grow(os, c);
                        obstack_1grow(os, c);