]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
0 isn't an error
authorAlan T. DeKok <aland@freeradius.org>
Thu, 28 Jul 2022 14:46:20 +0000 (10:46 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 29 Jul 2022 01:58:18 +0000 (21:58 -0400)
and we might as well print a meaningful error, too

src/lib/unlang/edit.c

index 1fdb2dfe049fa660c3c68da45024c71c6bc8e42a..94f17b302e54d0b96849ac609ad59a2025555ad0 100644 (file)
@@ -171,7 +171,8 @@ static int templatize_rhs(TALLOC_CTX *ctx, edit_result_t *out, fr_pair_t const *
         *      values.
         */
        if (fr_type_is_leaf(type) &&
-           (fr_value_box_cast_in_place(ctx, box, type, lhs->data.enumv) <= 0)) {
+           (fr_value_box_cast_in_place(ctx, box, type, lhs->data.enumv) < 0)) {
+               RPEDEBUG("Failed casting %pV to %s type %s enum %s", box, lhs->da->name, fr_type_to_str(type), lhs->data.enumv->name);
                return -1;
        }