Use int value provided by fgetc() to compare against EOF. Casting to char and back to int won't work on specific architectures.

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.
thanks for catching this! it's literally been about five years since i've looked at this code, but i'm a bit concerned about this GetCharPriv() call. the current version of the code calls the base class GetChar() method, which might return a buffered character if UngetChar() was called previously. with your change, it looks like it'll always call fgetc(). does a simpler change like https://github.com/derat/xsettingsd/commit/5cb0596b6db8a35ef20026b730829cbd7f77a10d also fix the issue for you?