keys.c (Key_Message): move backspace handling before non-printable

check. (the functionality doesn't change. from tyrquake git repo.)
minor tidy-up.

git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@843 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2013-04-02 21:40:48 +00:00
parent 472bcb8c28
commit 46e5feb71f
1 changed files with 5 additions and 8 deletions

View File

@ -508,20 +508,17 @@ void Key_Message (int key)
return; return;
} }
if (key < 32 || key > 127)
return; // non printable
if (key == K_BACKSPACE) if (key == K_BACKSPACE)
{ {
if (chat_bufferlen) if (chat_bufferlen)
{ chat_buffer[--chat_bufferlen] = 0;
chat_bufferlen--;
chat_buffer[chat_bufferlen] = 0;
}
return; return;
} }
if (chat_bufferlen == sizeof(chat_buffer)-1) if (key < 32 || key > 127)
return; // non printable
if (chat_bufferlen == sizeof(chat_buffer) - 1)
return; // all full return; // all full
chat_buffer[chat_bufferlen++] = key; chat_buffer[chat_bufferlen++] = key;