From aa42913eced86e91766e58d789d55f4309f0fde1 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sun, 26 Jun 2022 11:07:52 +0200 Subject: Fixed wrapped __xtsat call with NULL buffer (helps Surviving Mars) --- src/wrapped/wrappedlibc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/wrapped/wrappedlibc.c b/src/wrapped/wrappedlibc.c index f46da308..7ecd21b4 100755 --- a/src/wrapped/wrappedlibc.c +++ b/src/wrapped/wrappedlibc.c @@ -1013,8 +1013,9 @@ EXPORT int my___xstat(x64emu_t* emu, int v, void* path, void* buf) { (void)emu; (void)v; struct stat64 st; - int r = stat64((const char*)path, &st); - UnalignStat64(&st, buf); + int r = stat64((const char*)path, buf?&st:buf); + if(buf) + UnalignStat64(&st, buf); return r; } -- cgit 1.4.1