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

cppcheck: fix some reports #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

cppcheck: fix some reports #40

wants to merge 1 commit into from

Conversation

serval2412
Copy link
Contributor

vbox.h:356] -> [vbox.h:357]: (warning) Opposite conditions in nested 'if' blocks lead to a dead code block.
[vbox.h:416]: (style) Statements following return, break, continue, goto or throw will never be executed.
[vbox.h:420]: (style) Statements following return, break, continue, goto or throw will never be executed.

vbox.h:356] -> [vbox.h:357]: (warning) Opposite conditions in nested 'if' blocks lead to a dead code block.
[vbox.h:416]: (style) Statements following return, break, continue, goto or throw will never be executed.
[vbox.h:420]: (style) Statements following return, break, continue, goto or throw will never be executed.
@serval2412
Copy link
Contributor Author

I also noticed this one:
[floppyIO.cpp:176]: (error) Memory is allocated but not initialized: dataToReceive
which seems a bit serious and I don't know how to fix it:
171 char * dataToReceive = new char[this->szInput];
172 int dataLength = this->szInput;
173
174 // Find the size of the input string
175 for (int i=0; iszInput; i++) {
176 if (dataToReceive[0] == '\0') {
177 dataLength=i;
178 break;
179 }
180 }
Indeed, dataToReceive can contain anything.

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.

1 participant