Skip to content

Commit

Permalink
Fix obscure linux crash caused by using too small a buffer for wide c…
Browse files Browse the repository at this point in the history
…hars used with input
  • Loading branch information
bluebandit21 authored and poco0317 committed Jul 20, 2021
1 parent 9a37e08 commit fb7c101
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Etterna/Screen/Others/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ Screen::Update(float fDeltaTime)
unsigned iSize = m_QueuedMessages.size();

// send this sucker!
Locator::getLogger()->trace("ScreenMessage({})",
ScreenMessageHelpers::ScreenMessageToString(SM).c_str());
Locator::getLogger()->trace(
"ScreenMessage({})",
ScreenMessageHelpers::ScreenMessageToString(SM).c_str());
this->HandleScreenMessage(SM);

// If the size changed, start over.
Expand Down Expand Up @@ -420,7 +421,7 @@ Screen::PassInputToLua(const InputEventPlus& input)
lua_setfield(L, -2, "button");
Enum::Push(L, input.type);
lua_setfield(L, -2, "type");
char s[5];
char s[MB_LEN_MAX];
wctomb(s, INPUTMAN->DeviceInputToChar(input.DeviceI, true));
LuaHelpers::Push(L, std::string(1, s[0]));
lua_setfield(L, -2, "char");
Expand Down

0 comments on commit fb7c101

Please sign in to comment.