summaryrefslogtreecommitdiff
path: root/lib/lua/src/LuaLib/ldirlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/lua/src/LuaLib/ldirlib.c')
-rw-r--r--lib/lua/src/LuaLib/ldirlib.c5
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);