From 6fb96f3847bed4c2aba52497eb26b0d2d52207f9 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 7 Sep 2009 16:23:32 +0300 Subject: [PATCH] Help compilers/analyzers a bit with luaL_error() - luaL_error() never returns but as other tools dont know this it raises false alarms --- luaext/lposix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/luaext/lposix.c b/luaext/lposix.c index 270e246..cf609a5 100644 --- a/luaext/lposix.c +++ b/luaext/lposix.c @@ -183,7 +183,7 @@ static int aux_files(lua_State *L) { DIR *d = lua_touserdata(L, lua_upvalueindex(1)); struct dirent *entry; - if (d == NULL) luaL_error(L, "attempt to use closed dir"); + if (d == NULL) return luaL_error(L, "attempt to use closed dir"); entry = readdir(d); if (entry == NULL) { @@ -319,7 +319,7 @@ static int Pexec(lua_State *L) /** exec(path,[args]) */ const char *path = luaL_checkstring(L, 1); int i,n=lua_gettop(L); char **argv = malloc((n+1)*sizeof(char*)); - if (argv==NULL) luaL_error(L,"not enough memory"); + if (argv==NULL) return luaL_error(L,"not enough memory"); argv[0] = (char*)path; for (i=1; i