Skip to content

Commit 11b1a89

Browse files
committed
test
1 parent 68fec39 commit 11b1a89

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/validation.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,14 +1188,21 @@ lyd_validate_minmax(const struct lyd_node *first, const struct lyd_node *parent,
11881188

11891189
if (min) {
11901190
char suffix_path[256];
1191-
if (parent == NULL) {
1191+
1192+
lyd_node *debug_node = parent;
1193+
1194+
snprintf(suffix_path, sizeof(suffix_path), "/%s", snode->name);
1195+
1196+
if (debug_node == NULL) {
11921197
/* Real world this shouldn't happen, but test cases there may be no parent */
1193-
snprintf(suffix_path, sizeof(suffix_path), "/%s:%s", snode->module->name, snode->name);
1194-
} else {
1195-
snprintf(suffix_path, sizeof(suffix_path), "/%s", snode->name);
1198+
if (first.nodetype == LYS_LIST) {
1199+
debug_node = first;
1200+
} else {
1201+
snprintf(suffix_path, sizeof(suffix_path), "/%s:%s", snode->module->name, snode->name);
1202+
}
11961203
}
11971204

1198-
ly_log_location(NULL, parent, suffix_path, NULL);
1205+
ly_log_location(NULL, debug_node, suffix_path, NULL);
11991206
if (val_opts & LYD_VALIDATE_OPERATIONAL) {
12001207
LOGWRN(snode->module->ctx, "Too few \"%s\" instances.", snode->name);
12011208
} else {

0 commit comments

Comments
 (0)