about summary refs log tree commit diff stats
path: root/src/wrapped/wrappedlibc.c
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2021-03-10 09:25:19 +0100
committerptitSeb <sebastien.chev@gmail.com>2021-03-10 09:25:19 +0100
commit3fa01e53b9f67d455851fba778aa09d1037becef (patch)
treec0fefe4c06472d3592b7a5ec4fefaa3e5ecc82c5 /src/wrapped/wrappedlibc.c
parentecac1815dbc5b06e42093cf8cb494cd6ee455d8b (diff)
downloadbox64-3fa01e53b9f67d455851fba778aa09d1037becef.tar.gz
box64-3fa01e53b9f67d455851fba778aa09d1037becef.zip
Wrapped sprintf
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
-rwxr-xr-xsrc/wrapped/wrappedlibc.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c
index 75ca7825..d9c675cf 100755
--- a/src/wrapped/wrappedlibc.c
+++ b/src/wrapped/wrappedlibc.c
@@ -687,20 +687,14 @@ EXPORT int my_snprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void *
 }
 EXPORT int my___snprintf_chk(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_snprintf")));
 EXPORT int my___snprintf(x64emu_t* emu, void* buff, uint32_t s, void * fmt, void * b, va_list V) __attribute__((alias("my_snprintf")));
-
-EXPORT int my_sprintf(x64emu_t* emu, void* buff, void * fmt, void * b, va_list V) {
-    #ifndef NOALIGN
-    // need to align on arm
-    myStackAlign((const char*)fmt, b, emu->scratch);
+#endif
+EXPORT int my_sprintf(x64emu_t* emu, void* buff, void * fmt, void * b) {
+    myStackAlign(emu, (const char*)fmt, b, emu->scratch, R_EAX, 1);
     PREPARE_VALIST;
-    void* f = vsprintf;
-    return ((iFppp_t)f)(buff, fmt, VARARGS);
-    #else
-    return vsprintf((char*)buff, (char*)fmt, V);
-    #endif
+    return vsprintf(buff, (const char*)fmt, VARARGS);
 }
-EXPORT int my___sprintf_chk(x64emu_t* emu, void* buff, void * fmt, void * b, va_list V) __attribute__((alias("my_sprintf")));
-
+EXPORT int my___sprintf_chk(x64emu_t* emu, void* buff, void * fmt, void * b) __attribute__((alias("my_sprintf")));
+#if 0
 EXPORT int my_asprintf(x64emu_t* emu, void** buff, void * fmt, void * b, va_list V) {
     #ifndef NOALIGN
     // need to align on arm