From 97b522ec123acb28971f19953fb6558fe79daabf Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Wed, 13 Dec 2023 10:18:01 +1100 Subject: [PATCH] Explicitly cast void * pointers - allows code to build cleanly as C++. (#165) --- src/lfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lfs.c b/src/lfs.c index f0a0db9..f93db95 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -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; }