diff options
author | pixel <pixel> | 2008-08-05 09:23:09 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-08-05 09:23:09 +0000 |
commit | 09625f783913e2d57cb666760428909e5f7883a7 (patch) | |
tree | b51d14245cadc70c99800bc97c6e6d1854c6ef32 /lib/lua/src/LuaLib | |
parent | bf0c4cb31f764f6ec9a56576a9e9b800698ccd66 (diff) |
Silenting some warnings.
Diffstat (limited to 'lib/lua/src/LuaLib')
-rw-r--r-- | lib/lua/src/LuaLib/ldirlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/lua/src/LuaLib/ldirlib.c b/lib/lua/src/LuaLib/ldirlib.c index d12f1ab..3b14bdc 100644 --- a/lib/lua/src/LuaLib/ldirlib.c +++ b/lib/lua/src/LuaLib/ldirlib.c @@ -1,4 +1,5 @@ #include <stdlib.h> +#include <string.h> #include <dirent.h> #include <errno.h> #include <sys/stat.h> @@ -19,7 +20,7 @@ static int l_dir (lua_State *L) { DIR **d; /* create a userdatum to store a DIR address */ - p = lua_newuserdata(L, sizeof(DIR *) + strlen(path) + 1); + p = (char *) lua_newuserdata(L, sizeof(DIR *) + strlen(path) + 1); d = (DIR **) p; d_path = p + sizeof(DIR *); @@ -58,7 +59,7 @@ static int dir_iter (lua_State *L) { lua_pushstring(L, "name"); lua_pushstring(L, entry->d_name); lua_settable(L, -3); - fullpath = malloc(strlen(path) + strlen(entry->d_name) + 2); + fullpath = (char *) malloc(strlen(path) + strlen(entry->d_name) + 2); sprintf(fullpath, "%s/%s", path, entry->d_name); #ifdef _WIN32 _stat(fullpath, &file_stat); |