From: Michael Stapelberg Date: Sat, 29 Sep 2012 11:45:54 +0000 (+0200) Subject: backspace handling: do nothing when at the left-most position X-Git-Tag: rgb2rv9~22 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=52c2c0649de6cc9bbf4091be45ec13a9846662be;p=c128-kasse backspace handling: do nothing when at the left-most position --- diff --git a/src/general.c b/src/general.c index d40627e..0e50a72 100644 --- a/src/general.c +++ b/src/general.c @@ -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);