Skip to content

Commit

Permalink
Fix editor error
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed Oct 3, 2014
1 parent 54909a7 commit c4d5fa6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/tmpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,20 +773,17 @@ ssize_t tmpl_from_attr_substr(value_pair_tmpl_t *vpt, char const *name,
* The string MIGHT have a tag.
*/
if (*p == ':') {
if (!attr.da->flags.has_tag) {
fr_strerror_printf("Attribute '%s' cannot have a tag", attr.da->name);
return -(p - name);
}

num = strtol(p + 1, &q, 10);
if ((num > 0x1f) || (num < 0)) {
fr_strerror_printf("Invalid tag value '%li' (should be between 0-31)", num);
return -((p + 1)- name);
}

if (!attr.da->flags.has_tag) {
if (num != TAG_NONE) {
fr_strerror_printf("Attribute '%s' cannot have a tag", attr.da->name);
return -(p - name);
}
num = TAG_ANY;
}

attr.tag = num;
p = q;
}
Expand Down

0 comments on commit c4d5fa6

Please sign in to comment.