]> git.sur5r.net Git - c128-kasse/commitdiff
backspace handling: do nothing when at the left-most position
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 29 Sep 2012 11:45:54 +0000 (13:45 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 29 Sep 2012 11:45:54 +0000 (13:45 +0200)
src/general.c

index d40627e00bc04c586cd84fe3abd3bb810f332d87..0e50a7208a622f2b2fa4b7943b508f5f93d3c493 100644 (file)
@@ -33,6 +33,9 @@ char *get_input() {
                        break;
                /* backspace? */
                if (c == 20) {
+                       /* If you are at the left-most position, do nothing */
+                       if (i == 0)
+                               continue;
                        output[--i] = '\0';
                        cputcxy(x+i, y, ' ');
                        gotoxy(x+i, y);