clibs / cmocka

An elegant unit testing framework for C with support for mock objects.
Apache License 2.0
227 stars 55 forks source link

fix example usage comment #19

Closed adriancostin6 closed 2 years ago

adriancostin6 commented 2 years ago

dereferenced value of pointer compared against null to check malloc success instead of actual pointer. changed so it doesn't cause further confusion if anyone wants to use the provided example

jwerle commented 2 years ago

There are a few more occurrences of this. You can find all this *answer. Can you update all please?

[Edit] Actually, there is only one more https://github.com/clibs/cmocka/blob/master/include/cmocka.h#L1559

🙏🏼

adriancostin6 commented 2 years ago

@diasbruno @jwerle i wanted to push a squashed commit with this, so I had to force push (silly me didn't think this would close the pull request). the new pull request can be found here: https://github.com/clibs/cmocka/pull/20