This commit is contained in:
Dale Weiler 2013-11-23 03:54:11 -05:00
parent ae9d3d42cf
commit 3b6e7d0ce1

2
util.c
View file

@ -191,7 +191,7 @@ uint16_t util_crc16(uint16_t current, const char *k, size_t len) {
uint16_t util_crc16(const char *k, int len, const short clamp) {
register uint16_t h= (uint16_t)0xFFFFFFFF;
for (; len; --len, ++k)
h = util_crc16_table[(h^((unsigned char)*k))&0xFF]^(h>>8);
h = util_crc16_table[(h^((unsigned char)*k))&0xFF]^(h>>8);
return (~h)%clamp;
}
#endif