From b66e184f26629a333465d1908d7f0384ce5cc5f5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Tue, 12 Mar 2019 13:41:48 +0100 Subject: [PATCH] json2c: Fix a fatal warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit At the end, the case is never reached because json_object_to_json_string_ext only produces valid JSON strings and a string terminated by '\' isn't a valid JSON string. Change-Id: I58a6dc4d9c014487ff2dc85f7eb3dbf33ffea6b1 Signed-off-by: José Bollo --- src/devtools/json2c.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/devtools/json2c.c b/src/devtools/json2c.c index 1bc20b0c..9bb9e9bf 100644 --- a/src/devtools/json2c.c +++ b/src/devtools/json2c.c @@ -81,13 +81,13 @@ char *make_desc(struct json_object *o) } else if (c == '\\') { switch ((c = *b++)) { - case 0: - b--; - break; case '/': buf[0] = '/'; buf[1] = 0; break; + case 0: + b--; + /*@fallthrough@*/ default: buf[0] = '\\'; buf[1] = c; -- 2.16.6