libcheck / check

A unit testing framework for C
GNU Lesser General Public License v2.1
1.08k stars 210 forks source link

Fix format specifiers that do not match the argument types #271

Closed jamesjer closed 4 years ago

jamesjer commented 4 years ago

In check.h.in, %x is not safe to use with pointers, since it specifies an int-sized value but a pointer is passed in. On some platforms, int is 32 bits and void * is 64 bits.

In check_pack.c, note that t is a length modifier, not a conversion specifier. It must be followed by either d or u; d seems appropriate in this case.

The other changes are fairly obvious mismatches between the argument type and conversion specifier.

jamesjer commented 4 years ago

This commit fixes https://github.com/libcheck/check/issues/270

brarcher commented 4 years ago

Thanks for the fixes!