Fix trianglix buffer underflow.

This commit is contained in:
Jonas 'Sortie' Termansen 2016-01-18 14:33:12 +01:00
parent fbfe159046
commit b2f78fb4e1
1 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,6 @@
/*******************************************************************************
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014, 2015.
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014, 2015, 2016.
This file is part of trianglix.
@ -1720,7 +1720,10 @@ void HandleCodepoint(uint32_t codepoint, struct Desktop* desktop)
while ( desktop->command[column] )
column++;
if ( c == '\b' )
desktop->command[column-1] = '\0';
{
if ( column )
desktop->command[column-1] = '\0';
}
else if ( c == '\n' )
{
if ( !desktop->command[0] && desktop->num_actions != 0 )