From: Arran Cudbard-Bell Date: Thu, 31 May 2018 18:21:44 +0000 (+0600) Subject: Print the full attribute name on error X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d951e34c873e623d9708f1f77d01b5ead5cc28f;p=thirdparty%2Ffreeradius-server.git Print the full attribute name on error --- diff --git a/src/lib/util/dict.c b/src/lib/util/dict.c index bfcd30f616b..cfdc474bfeb 100644 --- a/src/lib/util/dict.c +++ b/src/lib/util/dict.c @@ -5458,19 +5458,17 @@ int fr_dict_global_init(TALLOC_CTX *ctx, char const *dict_dir) */ ssize_t fr_dict_valid_name(char const *name, ssize_t len) { - uint8_t const *p = (uint8_t const *)name, *end; + char const *p = name, *end; if (len < 0) len = strlen(name); end = p + len; do { if (!fr_dict_attr_allowed_chars[(int)*p]) { - char buff[5]; + fr_strerror_printf("Invalid character '%pV' in attribute name \"%pV\"", + fr_box_strvalue_len(p, 1), fr_box_strvalue_len(name, len)); - fr_snprint(buff, sizeof(buff), (char const *)p, 1, '\''); - fr_strerror_printf("Invalid character '%s' in attribute name", buff); - - return -(p - (uint8_t const *)name); + return -(p - name); } p++; } while (p < end);