summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-03-12 13:41:48 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2019-03-12 13:56:55 +0100
commitb66e184f26629a333465d1908d7f0384ce5cc5f5 (patch)
tree5bce565479ef245d374e697250a4ea1b5f96d752
parent85a5bd0a1ac34dbe30bc06f667ec27bac3cf6724 (diff)
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 <jose.bollo@iot.bzh>
-rw-r--r--src/devtools/json2c.c6
1 files 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;