Browse files

crc.c: "preheat" the checksum.

Not doing so lets a checksum succeed on (all zeros) empty memory.
  • Loading branch information...
1 parent a2185a4 commit 8e8a3da7fb5b8d251b6853211cb530236be48106 @Traumflug committed Oct 14, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 crc.c
View
2 crc.c
@@ -29,7 +29,7 @@
uses avr-libc's optimised crc16 routine
*/
uint16_t crc_block(void *data, uint16_t len) {
- uint16_t crc = 0;
+ uint16_t crc = 0xfeed;
for (; len; data++, len--) {
crc = _crc16_update(crc, *((uint8_t *) data));
}

0 comments on commit 8e8a3da

Please sign in to comment.