From: Jakob Haufe Date: Sat, 4 Nov 2017 22:39:13 +0000 (+0100) Subject: Do not crash when format_euro() fails X-Git-Tag: rgb2rv17^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3a0ee7dce566ac289c19d31bd3837ee1535dcf2b;p=c128-kasse Do not crash when format_euro() fails While it's sad format_euro fails here, it is not fatal. Calling exit makes us loose data, which is worse. Don't do this. --- diff --git a/src/kasse.c b/src/kasse.c index e509998..d5426c2 100644 --- a/src/kasse.c +++ b/src/kasse.c @@ -46,7 +46,7 @@ static void print_screen(void) { clrscr(); if (format_euro(profit, sizeof(profit), money) == NULL) { cprintf("Einnahme %ld konnte nicht umgerechnet werden\r\n", money); - exit(1); + profit[0]='\0'; } textcolor(TC_CYAN); cprintf("C128-Kassenprogramm (phil_fry, sECuRE, sur5r, mxf) " GV "\r\n");