From: José Bollo Date: Tue, 12 Mar 2019 12:41:48 +0000 (+0100) Subject: json2c: Fix a fatal warning X-Git-Tag: 7.99.1~37 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=b66e184f26629a333465d1908d7f0384ce5cc5f5 json2c: Fix a fatal warning 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 --- 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;