[Kernel] Change _vsnprintf overflow behavior.

This commit is contained in:
Anton Dorozhkin
2025-11-30 13:40:34 +07:00
committed by Radosław Gliński
parent 016797d19c
commit dfa70b3677

View File

@@ -1025,8 +1025,9 @@ SHIM_CALL _vsnprintf_entry(PPCContext* ppc_context) {
buffer[count] = '\0'; buffer[count] = '\0';
} }
} else { } else {
// Overflowed buffer. We still return the count we would have written. // Overflowed buffer.
std::memcpy(buffer, data.str().c_str(), buffer_count); std::memcpy(buffer, data.str().c_str(), buffer_count);
count = -1;
} }
SHIM_SET_RETURN_32(count); SHIM_SET_RETURN_32(count);
} }