summaryrefslogtreecommitdiff
path: root/lib/northbound_oper.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2025-03-31 22:40:38 +0000
committerChristian Hopps <chopps@labn.net>2025-04-10 04:53:08 +0000
commit4f9d16252678a1b2e41107cf2ed51ac61e096ae5 (patch)
tree42e1af414aba3328f999e9e5ddf87af54f045e09 /lib/northbound_oper.c
parentf9c759ee4e2308613739bda2c58d0073a9586fbb (diff)
lib: suppress clang-analyzer false-positives
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/northbound_oper.c')
-rw-r--r--lib/northbound_oper.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c
index d8f1bfa3fd..0ce9d77259 100644
--- a/lib/northbound_oper.c
+++ b/lib/northbound_oper.c
@@ -160,8 +160,8 @@ nb_op_create_yield_state(const char *xpath, struct yang_translator *translator,
/* remove trailing '/'s */
while (darr_len(ys->xpath) > 1 && ys->xpath[darr_len(ys->xpath) - 2] == '/') {
darr_setlen(ys->xpath, darr_len(ys->xpath) - 1);
- if (darr_last(ys->xpath))
- *darr_last(ys->xpath) = 0;
+ assert(darr_last(ys->xpath)); /* quiet clang-analyzer :( */
+ *darr_last(ys->xpath) = 0;
}
ys->xpath_orig = darr_strdup(xpath);
ys->translator = translator;
@@ -1670,7 +1670,8 @@ static enum nb_error __walk(struct nb_op_yield_state *ys, bool is_resume)
*/
if (!list_start && ni->inner && !lyd_child_no_keys(ni->inner) &&
/* not the top element with a key match */
- !((darr_ilen(ys->node_infos) == darr_ilen(ys->schema_path) - 1) &&
+ !(darr_ilen(ys->schema_path) && /* quiet clang-analyzer :( */
+ (darr_ilen(ys->node_infos) == darr_ilen(ys->schema_path) - 1) &&
lysc_is_key((*darr_last(ys->schema_path)))) &&
/* is this list entry below the query base? */
darr_ilen(ys->node_infos) - 1 < ys->query_base_level)