mirror of https://github.com/PCSX2/pcsx2.git
Console: Limit buffer size in ConsoleLogFromVM::Write
This commit is contained in:
parent
5d40f36fa8
commit
719063e996
|
@ -87,8 +87,7 @@ struct ConsoleLog : public LogBase
|
||||||
// ConsoleLogFromVM
|
// ConsoleLogFromVM
|
||||||
// --------------------------------------------------------------------------------------
|
// --------------------------------------------------------------------------------------
|
||||||
// Special console logger for Virtual Machine log sources, such as the EE and IOP console
|
// Special console logger for Virtual Machine log sources, such as the EE and IOP console
|
||||||
// writes (actual game developer messages and such). These logs do *not* automatically
|
// writes (actual game developer messages and such). These logs do *not* support printf
|
||||||
// append newlines, since the VM generates them manually; and they do *not* support printf
|
|
||||||
// formatting, since anything coming over the EE/IOP consoles should be considered raw
|
// formatting, since anything coming over the EE/IOP consoles should be considered raw
|
||||||
// string data. (otherwise %'s would get mis-interpreted).
|
// string data. (otherwise %'s would get mis-interpreted).
|
||||||
//
|
//
|
||||||
|
@ -102,24 +101,20 @@ public:
|
||||||
{
|
{
|
||||||
for (const char ch : msg)
|
for (const char ch : msg)
|
||||||
{
|
{
|
||||||
if (ch == '\n')
|
// Ignore control characters.
|
||||||
{
|
// Otherwise you get fun bells going off.
|
||||||
if (!m_buffer.empty())
|
if (ch < 0x20)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (ch != '\n')
|
||||||
|
m_buffer.push_back(ch);
|
||||||
|
|
||||||
|
if (ch == '\n' || m_buffer.size() >= 4096)
|
||||||
{
|
{
|
||||||
Console.WriteLn(conColor, m_buffer);
|
Console.WriteLn(conColor, m_buffer);
|
||||||
m_buffer.clear();
|
m_buffer.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ch < 0x20)
|
|
||||||
{
|
|
||||||
// Ignore control characters.
|
|
||||||
// Otherwise you get fun bells going off.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_buffer.push_back(ch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue