src/input.c

changeset 38
75ee459ba941
parent 35
6c64b7a073af
child 39
4d3d398ba689
--- a/src/input.c	Thu Apr 10 12:10:09 2014 +0200
+++ b/src/input.c	Sat Apr 12 13:42:57 2014 +0200
@@ -58,7 +58,9 @@
             return 1;
         case KEY_BACKSPACE:
         case KEY_LEFT:
-            str[--(*pos)] = '\0';
+            if ((*pos) > 0) {
+                str[--(*pos)] = '\0';
+            }
             break;
         default:
             if (isprint(c) && *pos < len-1) {

mercurial