Skip to content

Commit

Permalink
fix error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Dec 6, 2019
1 parent df02bbc commit 400678a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
5 changes: 0 additions & 5 deletions src/lib/util/dict_tokenize.c
Expand Up @@ -390,11 +390,6 @@ static int dict_process_flag_field(dict_tokenize_ctx_t *ctx, char *name, fr_type
fr_strerror_printf("The 'length' flag can only be used with value 'uint16'");
}

if ((type != FR_TYPE_STRING) && (type != FR_TYPE_OCTETS) && (type != FR_TYPE_STRUCT)) {
fr_strerror_printf("The 'length' flag can only be used for attributes of type 'string' or 'octets'");
return -1;
}

flags->extra = 1;
flags->subtype = FLAG_LENGTH_UINT16;

Expand Down
7 changes: 4 additions & 3 deletions src/lib/util/dict_validate.c
Expand Up @@ -267,9 +267,10 @@ bool dict_attr_flags_valid(fr_dict_t *dict, fr_dict_attr_t const *parent,

if ((flags->subtype == FLAG_LENGTH_UINT16) &&
((type != FR_TYPE_STRING) && (type != FR_TYPE_OCTETS) && (type != FR_TYPE_STRUCT))) {
fr_strerror_printf("The 'length' flag can only be used for attributes of type 'string' or 'octets'");
return -1;
}
fr_strerror_printf("The 'length' flag cannot be used used with type %s",
fr_table_str_by_value(fr_value_box_type_table, type, "<UNKNOWN>"));
return -1;
}

FORBID_OTHER_FLAGS(extra);
}
Expand Down

0 comments on commit 400678a

Please sign in to comment.