[recipes] Don't create a fraction with 0 denominator



commit 8498b89b2e937732ccf1c6295954e5c9f588c950
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 24 17:32:38 2017 -0400

    Don't create a fraction with 0 denominator
    
    This tends to cause division by zero.

 src/gr-ingredients-list.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-ingredients-list.c b/src/gr-ingredients-list.c
index 01706e3..592bd75 100644
--- a/src/gr-ingredients-list.c
+++ b/src/gr-ingredients-list.c
@@ -93,7 +93,7 @@ gr_ingredients_list_populate (GrIngredientsList  *ingredients,
                 segment = fields[3];
 
                 ing = g_new0 (Ingredient, 1);
-                gr_number_set_fraction (&ing->amount, 0, 0);
+                gr_number_set_fraction (&ing->amount, 0, 1);
                 if (amount[0] != '\0' &&
                     !gr_number_parse (&ing->amount, &amount, &local_error)) {
                         g_message ("failed to parse amount '%s': %s", amount, local_error->message);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]