Skip to content

Commit

Permalink
Explicitly cast void * pointers - allows code to build cleanly as C++. (
Browse files Browse the repository at this point in the history
  • Loading branch information
cuavas authored Dec 12, 2023
1 parent 472cd78 commit 97b522e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 97b522e

Please sign in to comment.