Browse Source

lib/kcore/km_crc.c Fixed wrong computation of crc32

The final result was not bitwise complemented, yeilding an incorrect result
(cherry picked from commit 342d6eb44fe6f795d7d31fc42ec6f7942859503b)
Marius Zbihlei 15 năm trước cách đây
mục cha
commit
a3812942d8
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      lib/kcore/km_crc.c

+ 1 - 1
lib/kcore/km_crc.c

@@ -25,6 +25,6 @@ void crc32_uint (str *source_string, unsigned int *hash_ret)
 		hash = crc_32_tab[((unsigned char)hash) ^ *data] ^ (hash >> 8);
 	}
 	
-	*hash_ret = hash;
+	*hash_ret = ~hash;
 }