about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2025-04-12 17:47:27 +0200
committerptitSeb <sebastien.chev@gmail.com>2025-04-12 17:47:27 +0200
commitfea05a30e8d65322de79220ba8a07857b9aea90f (patch)
tree475e05fc2b1b4d0bf52078ab0e8762fa4b4db570 /src
parente678e8428ba868e3a9e211beaaee79fa60fb2d30 (diff)
downloadbox64-fea05a30e8d65322de79220ba8a07857b9aea90f.tar.gz
box64-fea05a30e8d65322de79220ba8a07857b9aea90f.zip
[BOX32][WRAPPER] Some fixes to a few 32bits wrapped libc functions
Diffstat (limited to 'src')
-rwxr-xr-xsrc/wrapped32/wrappedlibc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/wrapped32/wrappedlibc.c b/src/wrapped32/wrappedlibc.c
index 6c01e369..2621face 100755
--- a/src/wrapped32/wrappedlibc.c
+++ b/src/wrapped32/wrappedlibc.c
@@ -985,20 +985,25 @@ EXPORT int my32_vasprintf(x64emu_t* emu, ptr_t* strp, void* fmt, void* b)
     *strp = to_ptrv(res);
     return r;
 }
-EXPORT int my32___vasprintf_chk(x64emu_t* emu, void* strp, int flags, void* fmt, void* b)
+EXPORT int my32___vasprintf_chk(x64emu_t* emu, ptr_t* strp, int flags, void* fmt, void* b)
 {
     // need to align on arm
     myStackAlign32((const char*)fmt, (uint32_t*)b, emu->scratch);
     PREPARE_VALIST_32;
-    int r = vasprintf(strp, fmt, VARARGS_32);
+    char* p = NULL;
+    int r = vasprintf(&p, fmt, VARARGS_32);
+    *strp = to_ptrv(p);
     return r;
 }
 
-EXPORT int my32___asprintf_chk(x64emu_t* emu, void* result_ptr, int flags, void* fmt, void* b)
+EXPORT int my32___asprintf_chk(x64emu_t* emu, ptr_t* result_ptr, int flags, void* fmt, void* b)
 {
     myStackAlign32((const char*)fmt, b, emu->scratch);
+    char* p = NULL;
     PREPARE_VALIST_32;
-    return vasprintf(result_ptr, fmt, VARARGS_32);
+    int ret = vasprintf(&p, fmt, VARARGS_32);
+    *result_ptr = to_ptrv(p);
+    return ret;
 }
 
 EXPORT int my32_vswprintf(x64emu_t* emu, void* buff, size_t s, void * fmt, uint32_t * b) {