aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lfs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lfs.c b/src/lfs.c
index e5e5ee4..f0a0db9 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -281,7 +281,7 @@ static int get_dir(lua_State * L)
281 break; 281 break;
282 } 282 }
283 path = path2; 283 path = path2;
284 if (getcwd(path, size) != NULL) { 284 if (getcwd(path, (int)size) != NULL) {
285 /* success, push the path to the Lua stack */ 285 /* success, push the path to the Lua stack */
286 lua_pushstring(L, path); 286 lua_pushstring(L, path);
287 result = 1; 287 result = 1;
@@ -1062,7 +1062,7 @@ static int push_link_target(lua_State * L)
1062 } 1062 }
1063#endif 1063#endif
1064 char *target = NULL; 1064 char *target = NULL;
1065 int tsize, size = 256; /* size = initial buffer capacity */ 1065 int tsize = 0, size = 256; /* size = initial buffer capacity */
1066 int ok = 0; 1066 int ok = 0;
1067 while (!ok) { 1067 while (!ok) {
1068 char *target2 = realloc(target, size); 1068 char *target2 = realloc(target, size);
@@ -1071,9 +1071,9 @@ static int push_link_target(lua_State * L)
1071 } 1071 }
1072 target = target2; 1072 target = target2;
1073#ifdef _WIN32 1073#ifdef _WIN32
1074 tsize = GetFinalPathNameByHandle(h, target, size, FILE_NAME_OPENED); 1074 tsize = (int)GetFinalPathNameByHandle(h, target, size, FILE_NAME_OPENED);
1075#else 1075#else
1076 tsize = readlink(file, target, size); 1076 tsize = (int)readlink(file, target, size);
1077#endif 1077#endif
1078 if (tsize < 0) { /* a readlink() error occurred */ 1078 if (tsize < 0) { /* a readlink() error occurred */
1079 break; 1079 break;