From 1bd1b885c7dd16b5e4ab78c040312f6f7d742784 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 30 Jan 2015 10:06:16 +0200 Subject: Disallow calling a function parameter. Check params are not function names. --- test/indirectcall.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/indirectcall.awk') diff --git a/test/indirectcall.awk b/test/indirectcall.awk index 5cfdd235..74290973 100644 --- a/test/indirectcall.awk +++ b/test/indirectcall.awk @@ -5,13 +5,13 @@ # average --- return the average of the values in fields $first - $last -function average(first, last, sum, i) +function average(first, last, the_sum, i) { - sum = 0; + the_sum = 0; for (i = first; i <= last; i++) - sum += $i + the_sum += $i - return sum / (last - first + 1) + return the_sum / (last - first + 1) } # sum --- return the average of the values in fields $first - $last -- cgit v1.2.3