unsigned extra_parity = find_parity_32(code);
/* no errors at all (user should have used has_error() first; boo, hiss) */
- if (hamming_parity == gen_hamming_parity && extra_parity == 1)
+ if (hamming_parity == gen_hamming_parity && extra_parity == 0)
return 0;
/* both hamming and simple parity errors; this is a single-bit error */
- if (hamming_parity != gen_hamming_parity && extra_parity == 0)
+ if (hamming_parity != gen_hamming_parity && extra_parity == 1)
return 0;
/* hamming says OK, but simple parity indicates an error => simple parity error is wrong */
- if (hamming_parity == gen_hamming_parity && extra_parity == 0)
+ if (hamming_parity == gen_hamming_parity && extra_parity == 1)
return 0;
/* hamming says error, simple parity says OK => DOUBLE ERROR */