awk: fix typo in atan2 code. closes bug 5594.
authorDenis Vlasenko <vda.linux@googlemail.com>
Tue, 21 Oct 2008 12:59:34 +0000 (12:59 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Tue, 21 Oct 2008 12:59:34 +0000 (12:59 -0000)
editors/awk.c

index 6ebdec4d320c715ae0ba1599a377cdb5be71c78d..bdf2a7fa0d5f47bf05d02676b910dfee087765a2 100644 (file)
@@ -2025,7 +2025,7 @@ static var *exec_builtin(node *op, var *res)
 
        case B_a2:
 #if ENABLE_FEATURE_AWK_MATH
-               setvar_i(res, atan2(getvar_i(av[i]), getvar_i(av[1])));
+               setvar_i(res, atan2(getvar_i(av[0]), getvar_i(av[1])));
 #else
                syntax_error(EMSG_NO_MATH);
 #endif