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++;