Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix <0 unsigned comparison (stat.st_size should be an off_t) #3515

Merged
merged 1 commit into from Nov 21, 2015
Merged

Fix <0 unsigned comparison (stat.st_size should be an off_t) #3515

merged 1 commit into from Nov 21, 2015

Conversation

jacquesg
Copy link
Contributor

Turns out that the error code path will never be entered seeing that assigning an int of value -1 to a uint64_t will give you 18446744073709551615.

@ethomson
Copy link
Member

POSIX defines st_size as an off_t. We probably should, too.

@jacquesg
Copy link
Contributor Author

That actually seems more reasonable, updated.

@jacquesg jacquesg changed the title Fix <0 unsigned comparison Fix <0 unsigned comparison (stat.st_size should be an off_t) Nov 20, 2015
ethomson added a commit that referenced this pull request Nov 21, 2015
Fix <0 unsigned comparison (stat.st_size should be an off_t)
@ethomson ethomson merged commit 66e4e6d into libgit2:master Nov 21, 2015
@ethomson
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants