fix a crash

This commit is contained in:
Tim Felgentreff 2022-04-02 12:21:39 +02:00
parent 6e7def937f
commit 4ac36b567e

View file

@ -847,7 +847,7 @@ static void InputKey(int key)
removeCursorFromInput();
// save to history
strncpy(InputHistory + (InputHistoryIdx * sizeof(Input)), Input, sizeof(Input));
if (InputHistorySize < MaxInputHistorySize) {
if (InputHistorySize < MaxInputHistorySize - 1) {
InputHistorySize++;
InputHistoryIdx = InputHistorySize;
} else {