efl_ui : fix infinite loop in efl_ui_exact model 96/200196/1
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>
Thu, 14 Feb 2019 13:50:04 +0000 (08:50 -0500)
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>
Wed, 20 Feb 2019 04:14:26 +0000 (13:14 +0900)
Summary:
the loop in infinite because of wrong condition.
need to loop while the count of list_index.

Reviewers: cedric, zmike

Subscribers: zmike, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7925

Change-Id: Id209ee3c44ec8225dd2ad6a7a07b04ad2338ce0c

src/lib/elementary/efl_ui_exact_model.c

index b44bd82..fac8298 100644 (file)
@@ -76,6 +76,7 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
    Eina_Binbuf *cbuf;
    Eina_Binbuf *tbuf;
    Eina_List *l = NULL;
+   unsigned int i;
 
    _efl_ui_exact_model_list_find(list_index, compressed, &l);
 
@@ -106,7 +107,10 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns
           }
 
         // Fill the list all the way to the needed index with buffer full of zero
-        while (list_index) compressed = eina_list_append(compressed, z);
+        for (i = 0; i < list_index; i++)
+          {
+             compressed = eina_list_append(compressed, z);
+          }
         l = eina_list_last(compressed);
      }