From: Michael Stapelberg Date: Sat, 29 Sep 2012 15:27:52 +0000 (+0200) Subject: show remaining credits when user has not enough credits X-Git-Tag: rgb2rv9~10 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e4291c495d24828979078c21635893068af5e12a;p=c128-kasse show remaining credits when user has not enough credits --- diff --git a/src/kasse.c b/src/kasse.c index 40bfbf5..977f801 100644 --- a/src/kasse.c +++ b/src/kasse.c @@ -152,7 +152,11 @@ static signed int buy(char *name, unsigned int price) { credit = find_credit(nickname); if (credit != NULL) { while ((signed int)credit->credit < ((signed int)price * einheiten)) { - cprintf("%s hat nicht genug Geld. e) einzahlen a) abbruch \r\n", nickname); + if (format_euro(rest, 10, credit->credit) == NULL) { + cprintf("Preis %d konnte nicht umgerechnet werden\r\n", credit->credit); + exit(1); + } + cprintf("\r\n%s hat nicht genug Geld (%s). e) einzahlen a) abbruch \r\n", nickname, rest); c = cgetc(); if (c == 'e') { deposit_credit(nickname);