aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-08-07 20:49:50 +0200
committerKim Alvefur <zash@zash.se>2016-08-07 20:49:50 +0200
commitabc0f19d31e6ed3565a31eaa75f0cadf9e48edd0 (patch)
tree33c4a320bf5af1d8458d87cc712094cbd717bcfd
parentabb6df1c2b4cfbfd936450ba892ad0c9ef688012 (diff)
downloadprosody-abc0f19d31e6ed3565a31eaa75f0cadf9e48edd0.tar.gz
prosody-abc0f19d31e6ed3565a31eaa75f0cadf9e48edd0.zip
util.table: Move loop variable to top of function for C89 compatibility
-rw-r--r--util-src/table.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util-src/table.c b/util-src/table.c
index 423f8f29..63415541 100644
--- a/util-src/table.c
+++ b/util-src/table.c
@@ -7,10 +7,11 @@ static int Lcreate_table(lua_State* L) {
}
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);