-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Conversation
Fixes a scan-build warning.
@@ -722,7 +722,6 @@ static size_t readback_bytes(mime_state *state, | |||
sz = numbytes - state->offset; | |||
|
|||
if(numbytes > state->offset) { | |||
sz = numbytes - state->offset; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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...
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!