fix warning about cast realignment, WIP

This commit is contained in:
Philippe Teuwen 2020-05-03 15:15:02 +02:00
commit c94eae0046
8 changed files with 30 additions and 24 deletions

View file

@ -23,8 +23,10 @@ void crc32_ex(const uint8_t *data, const size_t len, uint8_t *crc) {
for (size_t i = 0; i < len; i++) {
crc32_byte(&desfire_crc, data[i]);
}
*((uint32_t *)(crc)) = htole32(desfire_crc);
uint32_t crctmp = htole32(desfire_crc);
for (size_t i=0; i < sizeof(uint32_t); i++) {
crc[i] = ((uint8_t *) &crctmp)[i];
}
}
void crc32_append(uint8_t *data, const size_t len) {