From: Alan T. DeKok Date: Fri, 6 Dec 2019 13:51:11 +0000 (-0500) Subject: fix error messages X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=400678a110fec333723cafac8dffa3586c5fc41b;p=thirdparty%2Ffreeradius-server.git fix error messages --- diff --git a/src/lib/util/dict_tokenize.c b/src/lib/util/dict_tokenize.c index c34548b2325..3f98ae6615b 100644 --- a/src/lib/util/dict_tokenize.c +++ b/src/lib/util/dict_tokenize.c @@ -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; diff --git a/src/lib/util/dict_validate.c b/src/lib/util/dict_validate.c index 36ea48d0967..4268c9ddea7 100644 --- a/src/lib/util/dict_validate.c +++ b/src/lib/util/dict_validate.c @@ -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, "")); + return -1; + } FORBID_OTHER_FLAGS(extra); }