From 83a1fb7c3be44783b72cdad3cdfac5f328838358 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 18 Mar 2024 13:35:03 +1030 Subject: [PATCH] Escape "'s for json output. --- http-monitor.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.2