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

Add break; for switch default case in LC_VerifyMsgLength() #77

Closed
2 tasks done
thnkslprpt opened this issue Mar 13, 2023 · 0 comments · Fixed by #78
Closed
2 tasks done

Add break; for switch default case in LC_VerifyMsgLength() #77

thnkslprpt opened this issue Mar 13, 2023 · 0 comments · Fixed by #78

Comments

@thnkslprpt
Copy link
Contributor

Checklist

  • I reviewed the Contributing Guide.
  • I performed a cursory search to see if the bug report is relevant, not redundant, nor in conflict with other tickets.

Describe the bug
default case of the switch block in LC_VerifyMsgLength() is missing a break;.
Purely a style/guidelines issue for consistency and future maintenance.

Code snips

LC/fsw/src/lc_utils.c

Lines 83 to 92 in 2f177ae

default:
/*
** All other cases, increment error counter
*/
CFE_EVS_SendEvent(LC_LEN_ERR_EID, CFE_EVS_EventType_ERROR,
"Invalid msg length: ID = 0x%08lX, CC = %d, Len = %d, Expected = %d",
(unsigned long)CFE_SB_MsgIdToValue(MessageID), CommandCode, (int)ActualLength,
(int)ExpectedLength);
LC_AppData.CmdErrCount++;
}

Expected behavior
All switch cases (including default) should be terminated by an unconditional break statement.

Reporter Info
Avi Weiss @thnkslprpt

dzbaker added a commit that referenced this issue Apr 27, 2023
…-switch

Fix #77, Add break to default case of switch in LC_VerifyMsgLength
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants