]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't smash operator before printing it in error message
authorAlan T. DeKok <aland@freeradius.org>
Thu, 28 Sep 2023 12:33:04 +0000 (08:33 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 28 Sep 2023 12:33:04 +0000 (08:33 -0400)
src/lib/util/calc.c

index fbe782352eeeebca74b138b3535da6f43678a473..d1ba7c8ba86edb6e0c39678ced8668b0fc87414a 100644 (file)
@@ -2138,10 +2138,10 @@ int fr_value_calc_assignment_op(TALLOC_CTX *ctx, fr_value_box_t *dst, fr_token_t
                return fr_value_box_cast(ctx, dst, dst->type, dst->enumv, src); /* cast, as the RHS might not (yet) be the same! */
        }
 
-       op = assignment2op[op];
-       if (op == T_INVALID) {
+       if (assignment2op[op] == T_INVALID) {
                return handle_result(dst->type, op, ERR_INVALID);
        }
+       op = assignment2op[op];
 
        /*
         *      Just call the binary op function.  It already ensures that (a) the inputs are "const", and (b)