HLE: Log longer string args.

Sometimes was hiding useful parts of filenames, etc.
This commit is contained in:
Unknown W. Brackets 2023-04-16 19:17:45 -07:00
parent 129700596f
commit 1faa4031e6

View File

@ -794,10 +794,11 @@ size_t hleFormatLogArgs(char *message, size_t sz, const char *argmask) {
case 's':
if (Memory::IsValidAddress(regval)) {
const char *s = Memory::GetCharPointer(regval);
if (strnlen(s, 64) >= 64) {
APPEND_FMT("%.64s...", Memory::GetCharPointer(regval));
const int safeLen = Memory::ValidSize(regval, 128);
if (strnlen(s, safeLen) >= safeLen) {
APPEND_FMT("%.*s...", safeLen, Memory::GetCharPointer(regval));
} else {
APPEND_FMT("%s", Memory::GetCharPointer(regval));
APPEND_FMT("%.*s", safeLen, Memory::GetCharPointer(regval));
}
} else {
APPEND_FMT("(invalid)");