From 7cc94638ef7b3dd09b5845a12fa73d57488d8760 Mon Sep 17 00:00:00 2001 From: Pablo Oliveira Date: Mon, 18 Nov 2019 13:22:20 +0000 Subject: Fix comparison between pointer and integer in Doxigen example cmocka_run_group_tests Doxigen example should not dereference answer when checking the malloc result. --- include/cmocka.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/cmocka.h b/include/cmocka.h index f282c06..3e923dd 100644 --- a/include/cmocka.h +++ b/include/cmocka.h @@ -1835,7 +1835,7 @@ static inline void _unit_test_dummy(void **state) { * @code * static int setup(void **state) { * int *answer = malloc(sizeof(int)); - * if (*answer == NULL) { + * if (answer == NULL) { * return -1; * } * *answer = 42; @@ -1903,7 +1903,7 @@ int cmocka_run_group_tests(const struct CMUnitTest group_tests[], * @code * static int setup(void **state) { * int *answer = malloc(sizeof(int)); - * if (*answer == NULL) { + * if (answer == NULL) { * return -1; * } * *answer = 42; -- cgit v1.2.3