summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2021-11-23 10:49:36 +0100
committerDamjan Marion <dmarion@me.com>2021-11-25 15:25:34 +0000
commit4551715aaa647e5e565d81bd19fded8cacd8f778 (patch)
tree01ef98627f0003c6ba0e3b11fb2e0234d77a99e4 /src
parent5e0ea09d96010e99a7ce0d2f3370f0de50c46c83 (diff)
vppapigen: coverity 219549, dead code in generated file
Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I64804092917f1d8dc520549bacae81672a95cd1e
Diffstat (limited to 'src')
-rw-r--r--src/tools/vppapigen/vppapigen_c.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tools/vppapigen/vppapigen_c.py b/src/tools/vppapigen/vppapigen_c.py
index ae47625a474..d0f63fbdb0c 100644
--- a/src/tools/vppapigen/vppapigen_c.py
+++ b/src/tools/vppapigen/vppapigen_c.py
@@ -206,6 +206,8 @@ class ToJSON():
write(' cJSON *array = cJSON_CreateArray();\n')
for b in o.block:
+ if b[1] == 0:
+ continue
write(' if (a & {})\n'.format(b[0]))
write(' cJSON_AddItemToArray(array, cJSON_CreateString("{}"));\n'.format(b[0]))
write(' return array;\n')