mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-22 02:53:06 +00:00
Explicitly cast void * pointers - allows code to build cleanly as C++. (#165)
This commit is contained in:
@@ -275,7 +275,7 @@ static int get_dir(lua_State * L)
|
||||
size_t size = LFS_MAXPATHLEN; /* initial buffer size */
|
||||
int result;
|
||||
while (1) {
|
||||
char *path2 = realloc(path, size);
|
||||
char *path2 = (char *)realloc(path, size);
|
||||
if (!path2) { /* failed to allocate */
|
||||
result = pusherror(L, "get_dir realloc() failed");
|
||||
break;
|
||||
@@ -1065,7 +1065,7 @@ static int push_link_target(lua_State * L)
|
||||
int tsize = 0, size = 256; /* size = initial buffer capacity */
|
||||
int ok = 0;
|
||||
while (!ok) {
|
||||
char *target2 = realloc(target, size);
|
||||
char *target2 = (char *)realloc(target, size);
|
||||
if (!target2) { /* failed to allocate */
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user