crc.c: "preheat" the checksum.

Not doing so lets a checksum succeed on (all zeros) empty memory.
This commit is contained in:
Markus Hitter 2012-10-14 23:17:35 +02:00
parent a2185a4154
commit 8e8a3da7fb
1 changed files with 1 additions and 1 deletions

2
crc.c
View File

@ -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));
}