From 788b9ca2fa82c597917274d5d6ddfe37f44e551e Mon Sep 17 00:00:00 2001 From: vj586da Date: Thu, 14 Oct 2021 16:38:47 +0200 Subject: [PATCH] pridanie podmienky pre zle nacitanie --- cv2/program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cv2/program.c b/cv2/program.c index 0c07f99..bbb2330 100644 --- a/cv2/program.c +++ b/cv2/program.c @@ -56,7 +56,7 @@ int main(){ } ptr2 = fgets(temp, 20, stdin); food_database[meal_counter].price = strtof(temp, NULL); - if ( ptr2 == NULL ){ + if ( ptr2 == NULL || food_database[meal_counter].price == 0){ break; } meal_counter++;