Merge pull request #242 from sureshsundriyal/coverity

[coverity] Avoid a buffer-overrun.
pull/254/head
Tim Stack 9 years ago
commit 14755f6f75

@ -3863,7 +3863,10 @@ static void looper(void)
while ((ch = getch()) != ERR) {
alerter::singleton().new_input(ch);
if (escape_index >= sizeof(escape_buffer) - 1) {
/* Check to make sure there is enough space for a
* character and a string terminator.
*/
if (escape_index >= sizeof(escape_buffer) - 2) {
escape_index = 0;
}
else if (escape_index > 0) {

Loading…
Cancel
Save