summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2014-02-28 14:30:14 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2014-02-28 14:37:53 +0100
commitb70ff1340402975b384926470232bad954a93216 (patch)
treea7587ff567d4ef632b41c64fc60849975f28cd93
parent4e2e2ea01e9684efbee666e1fffd06301c80bf18 (diff)
examples/eina: Check return value of eina_iterator_next
If we define an API with warn_unused_result we should actually check the result in our examples.
-rw-r--r--src/examples/eina/eina_iterator_01.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/examples/eina/eina_iterator_01.c b/src/examples/eina/eina_iterator_01.c
index 5351ae96a2..510de1c5d0 100644
--- a/src/examples/eina/eina_iterator_01.c
+++ b/src/examples/eina/eina_iterator_01.c
@@ -48,13 +48,15 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
48 } 48 }
49 49
50 it = eina_array_iterator_new(array); 50 it = eina_array_iterator_new(array);
51 eina_iterator_next(it, (void **)&uninteresting); 51 if (!eina_iterator_next(it, (void **)&uninteresting))
52 return -1;
52 print_eina_container(it); 53 print_eina_container(it);
53 eina_array_free(eina_iterator_container_get(it)); 54 eina_array_free(eina_iterator_container_get(it));
54 eina_iterator_free(it); 55 eina_iterator_free(it);
55 56
56 it = eina_list_iterator_new(list); 57 it = eina_list_iterator_new(list);
57 eina_iterator_next(it, (void **)&uninteresting); 58 if (!eina_iterator_next(it, (void **)&uninteresting))
59 return -1;
58 print_eina_container(it); 60 print_eina_container(it);
59 eina_iterator_free(it); 61 eina_iterator_free(it);
60 62