elua: simplified source
authorDaniel Kolesa <quaker66@gmail.com>
Wed, 7 May 2014 09:09:52 +0000 (10:09 +0100)
committerDaniel Kolesa <d.kolesa@samsung.com>
Tue, 10 Jun 2014 14:48:50 +0000 (15:48 +0100)
src/bin/elua/main.c

index 3f575f5..f8449de 100644 (file)
@@ -226,7 +226,7 @@ static int elua_exec(lua_State *L) {
     }
 #else
     char *buf, *cptr;
-    size_t buflen = 0;
+    size_t buflen = 1;
     int i;
 
     STARTUPINFO si;
@@ -237,9 +237,6 @@ static int elua_exec(lua_State *L) {
 
     for (i = 1; i < lua_gettop(L); ++i) {
         buflen += lua_objlen(L, i + 1) + 2;
-        if (i != (lua_gettop(L) - 1)) {
-            buflen += 1;
-        }
     }
 
     buf = alloca(buflen + 1);