-
Notifications
You must be signed in to change notification settings - Fork 3k
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
ATHandler.cpp - Bad logical comparison #9014
Comments
Nice catch! I've created a quick PR for the fix. This definitely feels wrong, so let's see what the wan team has to say. |
Internal Jira reference: https://jira.arm.com/browse/MBOCUSTRIA-287 |
Closed #9018, since this was apparently intended. Another way of fixing this behavior would be this comment: #8350 (comment) @ARMmbed/mbed-os-wan I have to ask. Why is an assignment inside of the conditional statement needed? This feels very wrong from a code quality standpoint. |
I am not from mbed-os-wan so i can't say exactly but is suppose it was just the simplest way to not have the same code twice. However, rewriting the function seems to be a bit easier to read to me. Also moved the strlen() to the beginning so it only has to be calculated once. This is not tested but should have the same functionality.
|
Indeed, reason was what @marcemmers has supposed, to not duplicate the code needed in both matching cases |
@TacoGrandeTX Thanks for spotting this ! @mirelachirica please send a fix |
This is now fixed and in master, can be closed. |
Description
On a recent build off master I noticed this warning:
It sure looks like we intended this instead:
Not familiar with cellular, so will let someone else PR this if required.
Issue request type
The text was updated successfully, but these errors were encountered: