From: Michael Stapelberg Date: Mon, 1 Nov 2010 17:48:10 +0000 (+0100) Subject: use cgetc() and cputc() instead of getchar() X-Git-Tag: rgb2rv9~26 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1ba564778bc5e1e0af0d25ce6b6d23b8165f7338;p=c128-kasse use cgetc() and cputc() instead of getchar() --- diff --git a/src/general.c b/src/general.c index e1fb173..db7807c 100644 --- a/src/general.c +++ b/src/general.c @@ -26,10 +26,11 @@ char *get_input() { while (1) { if (i == 31) break; - c = getchar(); + c = cgetc(); if (c == 13) break; - else output[i++] = c; + cputc(c); + output[i++] = c; } return output; } diff --git a/src/itemz.c b/src/itemz.c index 274570f..f9ea82f 100644 --- a/src/itemz.c +++ b/src/itemz.c @@ -52,7 +52,7 @@ static void new_item() { if ((input = get_input()) == NULL || *input == '\0' || (price = atoi(input)) == 0) return; cprintf("\r\nWie oft schon verkauft? [0] \r\n"); - if ((input = get_input()) == NULL || *input == '\0') + if ((input = get_input()) == NULL) return; memset(status.status[status.num_items].item_name, '\0', MAX_ITEM_NAME_LENGTH+1); strncpy(status.status[status.num_items].item_name, name, MAX_ITEM_NAME_LENGTH);