Skip to content

Commit

Permalink
Update core.c
Browse files Browse the repository at this point in the history
fixed indent and vars
  • Loading branch information
ashtoreth committed Nov 8, 2014
1 parent ed70d07 commit 2f64d63
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/lua-lxc/core.c
Expand Up @@ -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;
Expand Down

0 comments on commit 2f64d63

Please sign in to comment.