From ee8d72ea8d8edccb32b10bfa9990958c02177b78 Mon Sep 17 00:00:00 2001 From: Ted John Date: Tue, 20 Mar 2018 16:48:39 +0000 Subject: [PATCH] Replace magic numbers with CONSOLE_INPUT_SIZE --- src/openrct2-ui/interface/InGameConsole.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 62ce69378c..0330bb1e38 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -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);