Sat, 12 Apr 2014 13:42:57 +0200
fixed memory underflow bug in mvwasyncgetnstr
src/input.c | file | annotate | diff | comparison | revisions |
1.1 --- a/src/input.c Thu Apr 10 12:10:09 2014 +0200 1.2 +++ b/src/input.c Sat Apr 12 13:42:57 2014 +0200 1.3 @@ -58,7 +58,9 @@ 1.4 return 1; 1.5 case KEY_BACKSPACE: 1.6 case KEY_LEFT: 1.7 - str[--(*pos)] = '\0'; 1.8 + if ((*pos) > 0) { 1.9 + str[--(*pos)] = '\0'; 1.10 + } 1.11 break; 1.12 default: 1.13 if (isprint(c) && *pos < len-1) {