flutter: Fix null ptr ref

Step:
AI vs AI
Back
Settings
Crash
This commit is contained in:
Calcitem 2021-01-02 00:45:52 +08:00
parent 0d35054f35
commit 450643a043
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ bool CommandQueue::read(char *dest)
return false;
}
strncpy(dest, commands[readIndex], COMMAND_LENGTH);
strncpy(dest, commands[readIndex], 1024); // See uci.cpp LINE_INPUT_MAX_CHAR
strncpy(commands[readIndex], "", COMMAND_LENGTH);
if (++readIndex == MAX_COMMAND_COUNT) {