summaryrefslogtreecommitdiff
path: root/swat/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'swat/scripting')
-rw-r--r--swat/scripting/common.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/swat/scripting/common.js b/swat/scripting/common.js
index cdf18d1c9b..2e90c1b469 100644
--- a/swat/scripting/common.js
+++ b/swat/scripting/common.js
@@ -100,10 +100,11 @@ function display_menu(m) {
}
function simple_menu() {
- var m = MenuObj(arguments[0], (arguments.length-1)/2);
+ var i, m = MenuObj(arguments[0], (arguments.length-1)/2);
for (i=0;i<m.element.length;i++) {
- m.element[i].label = arguments[1+(i*2)];
- m.element[i].link = arguments[2+(i*2)];
+ var ndx = i*2;
+ m.element[i].label = arguments[ndx+1];
+ m.element[i].link = arguments[ndx+2];
}
display_menu(m);
}