From b70ff1340402975b384926470232bad954a93216 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 28 Feb 2014 14:30:14 +0100 Subject: [PATCH] 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. --- src/examples/eina/eina_iterator_01.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/examples/eina/eina_iterator_01.c b/src/examples/eina/eina_iterator_01.c index 5351ae9..510de1c 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) } it = eina_array_iterator_new(array); - eina_iterator_next(it, (void **)&uninteresting); + if (!eina_iterator_next(it, (void **)&uninteresting)) + return -1; print_eina_container(it); eina_array_free(eina_iterator_container_get(it)); eina_iterator_free(it); it = eina_list_iterator_new(list); - eina_iterator_next(it, (void **)&uninteresting); + if (!eina_iterator_next(it, (void **)&uninteresting)) + return -1; print_eina_container(it); eina_iterator_free(it); -- 2.7.4