+2
-2
src/api/system.c
+2
-2
src/api/system.c
···
335
335
static int f_exec(lua_State *L) {
336
336
size_t len;
337
337
const char *cmd = luaL_checklstring(L, 1, &len);
338
-
char *buf = malloc(len + 16);
338
+
char *buf = malloc(len + 32);
339
339
if (!buf) { luaL_error(L, "buffer allocation failed"); }
340
340
#if _WIN32
341
-
sprintf(buf, "cmd /c %s", cmd);
341
+
sprintf(buf, "cmd /c \"%s\"", cmd);
342
342
WinExec(buf, SW_HIDE);
343
343
#else
344
344
sprintf(buf, "%s &", cmd);