Skip to content

Commit a38684b

Browse files
committed
Fixed dev console string append issues on Windows
1 parent 7463a73 commit a38684b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

engine/utils/String.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ void String::Append(char character)
510510
const char* data = Data();
511511
size_t lhsLength = Size();
512512

513-
char cstr[lhsLength + 1];
513+
char cstr[lhsLength + 2];
514514
strcpy(cstr, data);
515515
cstr[lhsLength] = character;
516516
cstr[lhsLength + 1] = '\0';

examples/game/src/tools/DevConsole.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void DevConsole::OnUpdate()
3737
char key;
3838
while ((key = (char) Siege::Input::GetLatestChar()) > 0)
3939
{
40-
if ((key >= 32) && (key <= 125) &&
40+
if (key >= 32 && key <= 125 &&
4141
!(key == Siege::Key::KEY_GRAVE_ACCENT && inputText.IsEmpty()))
4242
inputText += key;
4343
}

0 commit comments

Comments
 (0)