From 3a0ee7dce566ac289c19d31bd3837ee1535dcf2b Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Sat, 4 Nov 2017 23:39:13 +0100 Subject: [PATCH] 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. --- src/kasse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.39.5