You're using the integer value 0x38
as a pointer, which is very likely not a good idea.
You should probably have:
const uint8_t data[] = { 0x38 };
if(memcmp(datap, data, sizeof data) == 0)
Or, of course, since it's just a single byte:
if(((uint8_t *) datap)[0] == 0x38)
UPDATE Assuming that datap
is declared to be unsigned char *datap
, we can drop the cast and just do:
if(*datap == 0x38)