Example on ppc64 for the old code:
fgetc() reads 0xFFFFFFFF (int, -1). Then converted to 0xFF (char, ÿ).
Then converted to 0x000000FF (int, ÿ).
Compared against EOF macro 0xFFFFFFFF (int, -1).
Obviously not the same value.
Example on ppc64 for the old code:
fgetc() reads 0xFFFFFFFF (int, -1). Then converted to 0xFF (char, ÿ).
Then converted to 0x000000FF (int, ÿ).
Compared against EOF macro 0xFFFFFFFF (int, -1).
Obviously not the same value.