util.table: Move loop variable to top of function for C89 compatibility
authorKim Alvefur <zash@zash.se>
Sun, 07 Aug 2016 20:49:50 +0200
changeset 7541 a3a4ed0d34f4
parent 7540 a0813737c6fa
child 7542 366964dbddb1
util.table: Move loop variable to top of function for C89 compatibility
util-src/table.c
--- a/util-src/table.c	Sun Aug 07 20:48:37 2016 +0200
+++ b/util-src/table.c	Sun Aug 07 20:49:50 2016 +0200
@@ -7,10 +7,11 @@
 }
 
 static int Lpack(lua_State* L) {
+	int arg;
 	unsigned int n_args = lua_gettop(L);
 	lua_createtable(L, n_args, 1);
 	lua_insert(L, 1);
-	for(int arg = n_args; arg >= 1; arg--) {
+	for(arg = n_args; arg >= 1; arg--) {
 		lua_rawseti(L, 1, arg);
 	}
 	lua_pushinteger(L, n_args);