1
0
Fork 0

Merge pull request #4233 from lioncash/debug

kernel/svc: Do nothing if svcOutputDebugString's length is <= 0
This commit is contained in:
Weiyi Wang 2018-09-17 21:21:06 -04:00 committed by GitHub
commit 241f10a669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -662,6 +662,10 @@ static void Break(u8 break_reason) {
/// Used to output a message on a debug hardware unit - does nothing on a retail unit /// Used to output a message on a debug hardware unit - does nothing on a retail unit
static void OutputDebugString(VAddr address, int len) { static void OutputDebugString(VAddr address, int len) {
if (len <= 0) {
return;
}
std::string string(len, ' '); std::string string(len, ' ');
Memory::ReadBlock(address, string.data(), len); Memory::ReadBlock(address, string.data(), len);
LOG_DEBUG(Debug_Emulated, "{}", string); LOG_DEBUG(Debug_Emulated, "{}", string);