summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Oliveira <pablo@sifflez.org>2019-11-18 13:22:20 +0000
committerAndreas Schneider <asn@cryptomilk.org>2019-11-19 15:41:23 +0100
commit7cc94638ef7b3dd09b5845a12fa73d57488d8760 (patch)
tree2995cd50a3f6dbecffe58d4c22246b53324daa6f
parent61ab1b920753ec72a80b03dc12432d13c3aa19c7 (diff)
downloadcmocka-7cc94638ef7b3dd09b5845a12fa73d57488d8760.tar.gz
cmocka-7cc94638ef7b3dd09b5845a12fa73d57488d8760.tar.xz
cmocka-7cc94638ef7b3dd09b5845a12fa73d57488d8760.zip
Fix comparison between pointer and integer in Doxigen example
cmocka_run_group_tests Doxigen example should not dereference answer when checking the malloc result.
-rw-r--r--include/cmocka.h4
1 files 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;