From: Not Zed Date: Mon, 18 Mar 2024 03:05:03 +0000 (+1030) Subject: Escape "'s for json output. X-Git-Url: https://code.zedzone.au/cvs?a=commitdiff_plain;h=83a1fb7c3be44783b72cdad3cdfac5f328838358;p=playerz Escape "'s for json output. --- diff --git a/http-monitor.c b/http-monitor.c index de5ebbc..c94defb 100644 --- a/http-monitor.c +++ b/http-monitor.c @@ -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);