1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-04 13:42:55 +01:00

Replace magic numbers with CONSOLE_INPUT_SIZE

This commit is contained in:
Ted John
2018-03-20 16:48:39 +00:00
parent aba142f99c
commit ee8d72ea8d

View File

@@ -48,7 +48,7 @@ void InGameConsole::Input(CONSOLE_INPUT input)
case CONSOLE_INPUT_HISTORY_PREVIOUS:
if (_consoleHistoryIndex > 0) {
_consoleHistoryIndex--;
memcpy(_consoleCurrentLine, _consoleHistory[_consoleHistoryIndex], 256);
memcpy(_consoleCurrentLine, _consoleHistory[_consoleHistoryIndex], CONSOLE_INPUT_SIZE);
}
_consoleTextInputSession->Size = strlen(_consoleTextInputSession->Buffer);
_consoleTextInputSession->Length = utf8_length(_consoleTextInputSession->Buffer);
@@ -57,7 +57,7 @@ void InGameConsole::Input(CONSOLE_INPUT input)
case CONSOLE_INPUT_HISTORY_NEXT:
if (_consoleHistoryIndex < _consoleHistoryCount - 1) {
_consoleHistoryIndex++;
memcpy(_consoleCurrentLine, _consoleHistory[_consoleHistoryIndex], 256);
memcpy(_consoleCurrentLine, _consoleHistory[_consoleHistoryIndex], CONSOLE_INPUT_SIZE);
_consoleTextInputSession->Size = strlen(_consoleTextInputSession->Buffer);
_consoleTextInputSession->Length = utf8_length(_consoleTextInputSession->Buffer);
_consoleTextInputSession->SelectionStart = strlen(_consoleCurrentLine);