2
24
Fork
You've already forked xsettingsd
6

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

Closed
Ionic wants to merge 1 commit from master into main
pull from: master
merge into: derat:main
derat:main
Ionic commented 2014年11月22日 02:23:36 +01:00 (Migrated from github.com)
Copy link

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.
derat commented 2014年11月23日 05:27:39 +01:00 (Migrated from github.com)
Copy link

thanks for catching this! definitely a bug.

thanks for catching this! definitely a bug.

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
derat/xsettingsd!6
Reference in a new issue
derat/xsettingsd
No description provided.
Delete branch "master"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?