diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2025-04-09 09:59:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-09 09:59:06 +0200 |
| commit | 8418e57791eabc9feba637b69bd9ee35bed6860a (patch) | |
| tree | 48b9c05795135606782f9ec359c3f319f5d534dc /lib/northbound_oper.c | |
| parent | 1d426d99619b7818f4b63b52f83fadfe902b9854 (diff) | |
| parent | 27ba9956a15c17b7e8a6ba38aa8bbb4514fa90df (diff) | |
Merge pull request #17915 from mjstapp/compile_wshadow
Diffstat (limited to 'lib/northbound_oper.c')
| -rw-r--r-- | lib/northbound_oper.c | 3 |
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; |
