diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-10 09:25:19 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-10 09:25:19 +0100 |
| commit | 3fa01e53b9f67d455851fba778aa09d1037becef (patch) | |
| tree | c0fefe4c06472d3592b7a5ec4fefaa3e5ecc82c5 /src/wrapped/wrappedlibc.c | |
| parent | ecac1815dbc5b06e42093cf8cb494cd6ee455d8b (diff) | |
| download | box64-3fa01e53b9f67d455851fba778aa09d1037becef.tar.gz box64-3fa01e53b9f67d455851fba778aa09d1037becef.zip | |
Wrapped sprintf
Diffstat (limited to 'src/wrapped/wrappedlibc.c')
| -rwxr-xr-x | src/wrapped/wrappedlibc.c | 18 |
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 |