From e53fd10edd37beb1bc5b6274f12f2d792785d205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 2 Feb 2025 11:46:08 -0600 Subject: [PATCH] Format string fix in hleDoLogInternal Hopefully fixes #19935, but can't confirm myself right now. --- Core/HLE/HLE.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Core/HLE/HLE.cpp b/Core/HLE/HLE.cpp index e708615740..fdac2eced9 100644 --- a/Core/HLE/HLE.cpp +++ b/Core/HLE/HLE.cpp @@ -1026,6 +1026,7 @@ void hleDoLogInternal(Log t, LogLevel level, u64 res, const char *file, int line fmt = "%sSCE_KERNEL_ERROR_%s=%s(%s)%s"; } else { fmt = "%s%08llx=%s(%s)%s"; + errStr = nullptr; // We check errstr later to determine which format to use. } break; case 'i': @@ -1035,6 +1036,7 @@ void hleDoLogInternal(Log t, LogLevel level, u64 res, const char *file, int line fmt = "%sSCE_KERNEL_ERROR_%s=%s(%s)%s"; } else { fmt = "%s%lld=%s(%s)%s"; + errStr = nullptr; // We check errstr later to determine which format to use. } break; case 'f': @@ -1042,8 +1044,8 @@ void hleDoLogInternal(Log t, LogLevel level, u64 res, const char *file, int line fmt = "%s%08llx=%s(%s)%s"; break; case 'v': - // Void. Return value should not be shown. - fmt = "%s=%s(%s)%s"; + // Void. Return value should not be shown. (the first %s is the "K " string, see below). + fmt = "%s%s(%s)%s"; break; default: _dbg_assert_msg_(false, "Invalid return format: %c", retmask);