json: do not print output on a JSON parse error - frontends - front-ends for some sites (experiment)
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 587b2d3d299bff29e6b941c22fe7aa526cbc9135
(DIR) parent 61d393efb87ceac4df82a714d1ecf13fcf1ee664
(HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Fri, 24 Feb 2023 17:25:38 +0100
json: do not print output on a JSON parse error
Diffstat:
M json.c | 2 ++
1 file changed, 2 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/json.c b/json.c
@@ -111,8 +111,10 @@ capacity(char **value, size_t *sz, size_t cur, size_t inc)
#define JSON_INVALID() do { ret = JSON_ERROR_INVALID; goto end; } while (0);
/* DEBUG */
+#ifdef DEBUG
#undef JSON_INVALID
#define JSON_INVALID() do { ret = JSON_ERROR_INVALID; fprintf(stderr, "%zu: expect %s, data: %s\n", json_data_off, expect, json_data + json_data_off); goto end; } while (0);
+#endif
int
parsejson(const char *s, size_t slen,