]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Update core.c 353/head
authorashtoreth <ashtoreth@users.noreply.github.com>
Sat, 8 Nov 2014 14:04:32 +0000 (16:04 +0200)
committerashtoreth <ashtoreth@users.noreply.github.com>
Sat, 8 Nov 2014 14:04:32 +0000 (16:04 +0200)
fixed indent and vars

src/lua-lxc/core.c

index 67886a4fca27a60541a07557d576e48a5978040c..87341285b51d8200ca43db4f83f9cf8371d999af 100644 (file)
@@ -381,21 +381,21 @@ static int container_attach(lua_State *L)
     struct lxc_container *c = lua_unboxpointer(L, 1, CONTAINER_TYPENAME);
     int argc = lua_gettop(L);
     char **argv = NULL;
-    int i,j;
+    int i;
 
     if (argc > 1) {
        argv = alloca((argc+1) * sizeof(char *));
-       for (i = 0, j = 0; i < argc-1; i++) {
-           const char *arg = luaL_checkstring(L, i+2);
-               argv[j++] = strdupa(arg);
-         }
-         argv[j] = NULL;
-    }
-       else
-       {
-         lua_pushnil(L);
-         return 1;
+       for (i = 0; i < argc-1; i++) {
+               const char *arg = luaL_checkstring(L, i+2);
+               argv[i] = strdupa(arg);
        }
+       argv[i] = NULL;
+    }
+    else
+    {
+       lua_pushnil(L);
+       return 1;
+    }
 
     lua_pushboolean(L, !!(c->attach_run_wait(c, NULL, argv[0], (const char**)argv)));
     return 1;