Explicitly cast void * pointers - allows code to build cleanly as C++. (#165)

This commit is contained in:
Vas Crabb
2023-12-13 10:18:01 +11:00
committed by GitHub
parent 472cd783d7
commit 97b522ec12

View File

@@ -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;
}