mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
Fix type of variable used to store fgetc() result
fgetc() returns an int. Fix process_config_file() to store the result in an int, so that comparisons against EOF succeed. Previously, If "char" defaulted to unsigned (which may be true for armhf), then when fgetc() returned -1, it would be truncated to 255 when stored in the char, and then zero-filled rather than sign-extended when comparing against EOF, which would then fail. See http://code.google.com/p/chromium-os/issues/detail?id=25632. Reported-by: Paul Fertser <fercerpav@gmail.com> Signed-off-by: Stephen Warren <swarren@nvidia.com> Change-Id: I018e32df9a87b7c6f9fe24d108e091a7b31a50c8 Reviewed-on: http://git-master/r/192151 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Allen Martin <amartin@nvidia.com>
This commit is contained in:
Reference in New Issue
Block a user