Prevent any potential issues due to sign extension (which could occur on platforms where int is 16 bits).

This commit is contained in:
Ken MacKay
2013-10-01 10:45:08 -07:00
parent f9ae23e4b4
commit 6c13203965
+1 -1
View File
@@ -1508,7 +1508,7 @@ void ecc_bytes2native(uint32_t p_native[NUM_ECC_DIGITS], uint8_t p_bytes[NUM_ECC
for(i=0; i<NUM_ECC_DIGITS; ++i)
{
uint8_t *p_digit = p_bytes + 4 * (NUM_ECC_DIGITS - 1 - i);
p_native[i] = (p_digit[0] << 24) | (p_digit[1] << 16) | (p_digit[2] << 8) | p_digit[3];
p_native[i] = ((uint32_t)p_digit[0] << 24) | ((uint32_t)p_digit[1] << 16) | ((uint32_t)p_digit[2] << 8) | (uint32_t)p_digit[3];
}
}