]> git.ipfire.org Git - thirdparty/nftables.git/commit
json: Print single fib flag as non-array
authorPhil Sutter <phil@nwl.cc>
Thu, 8 May 2025 14:40:41 +0000 (16:40 +0200)
committerPhil Sutter <phil@nwl.cc>
Tue, 13 May 2025 08:48:53 +0000 (10:48 +0200)
commitdbe5c44f2b891c1d305cc94a7ea9dd963a7b6100
tree3f94b4e29749a1ceacc818f114d6dd94028d6e29
parent6bedb12af1658562f277ca68d74cf1e9e7433a08
json: Print single fib flag as non-array

Check array size and reduce the array if possible.

The zero array length check is dead code here due to the surrounding 'if
(flags)' block, but it's a common idiom one could replace by a shared
routine later.

Signed-off-by: Phil Sutter <phil@nwl.cc>
src/json.c