Skip to content

Commit

Permalink
better error messages, so that we know what's going on
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Oct 11, 2023
1 parent 196f901 commit 350ca9b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/lib/util/pair_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,15 @@ static ssize_t fr_pair_list_afrom_substr(TALLOC_CTX *ctx, fr_dict_attr_t const *
if (err == FR_DICT_ATTR_NOTFOUND) {
uint8_t const *q;

notfound:
for (q = (uint8_t const *) p; q < (uint8_t const *) end && fr_dict_attr_allowed_chars[*q]; q++) {
/* nothing */
if (!fr_dict_attr_allowed_chars[(unsigned char) *p]) {
fr_strerror_printf("Invalid character '%c' in attribute name at %s", *p, p);
} else {
notfound:
for (q = (uint8_t const *) p; q < (uint8_t const *) end && fr_dict_attr_allowed_chars[*q]; q++) {
/* nothing */
}
fr_strerror_printf("Unknown attribute \"%.*s\" for parent \"%s\"", (int) (q - ((uint8_t const *) p)), p, my_parent->name);
}
fr_strerror_printf("Unknown attribute \"%.*s\" for parent \"%s\"", (int) (q - ((uint8_t const *) p)), p, my_parent->name);
}
error:
fr_dict_unknown_free(&da_unknown);
Expand Down

0 comments on commit 350ca9b

Please sign in to comment.