summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Stapp <mjs@cisco.com>2025-03-27 15:16:05 -0400
committerMark Stapp <mjs@cisco.com>2025-04-08 14:41:27 -0400
commit27ba9956a15c17b7e8a6ba38aa8bbb4514fa90df (patch)
tree0cb65e13b057e66321851e7f55686d179482e92d /lib
parente2515f7a4f6573f987435edd18ae8d6f8a3ee758 (diff)
lib,ripd: resolve clang SA warnings
Looks like there were a couple of SA warnings lurking; fix them. Signed-off-by: Mark Stapp <mjs@cisco.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/northbound_oper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c
index 626c37082e..d9ad9b1701 100644
--- a/lib/northbound_oper.c
+++ b/lib/northbound_oper.c
@@ -157,7 +157,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);
- *darr_last(ys->xpath) = 0;
+ if (darr_last(ys->xpath))
+ *darr_last(ys->xpath) = 0;
}
ys->xpath_orig = darr_strdup(xpath);
ys->translator = translator;