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 errors detected by scan-build #2098

Closed
wants to merge 7 commits into from
Closed

Conversation

bagder
Copy link
Member

@bagder bagder commented Nov 20, 2017

I ran scan-build on the code and cleaned up some low hanging fruit. The automated scan-build I run uses a much older clang version and didn't catch any of these!

@bagder bagder changed the title Bagder/scan build fixes Fix errors detected by scan-build Nov 20, 2017
@@ -722,7 +722,6 @@ static size_t readback_bytes(mime_state *state,
sz = numbytes - state->offset;

if(numbytes > state->offset) {
sz = numbytes - state->offset;
Copy link
Member

@jay jay Nov 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see how this one is right. sz is used later on

Copy link
Member

@jay jay Nov 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nm I see it now, it was set above. it would probably be easier to understand if it was set here and the one above removed

Copy link
Member Author

@bagder bagder Nov 21, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah probably, was more thinking that it could benefit of being set unconditionally first so that one wouldn't think it risked ending up not being set...

@bagder bagder closed this in 9554c3c Nov 21, 2017
@bagder bagder deleted the bagder/scan-build-fixes branch Nov 21, 2017
@lock lock bot locked as resolved and limited conversation to collaborators May 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants