-
Notifications
You must be signed in to change notification settings - Fork 25
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 #99, Fill in Name
variable to avoid being used uninitialized
#100
base: main
Are you sure you want to change the base?
Fix #99, Fill in Name
variable to avoid being used uninitialized
#100
Conversation
c4e87dc
to
4b79eaf
Compare
|
||
if (CS_GetAppResTblEntryByName(&ResultsEntry, Name)) | ||
if (CS_GetAppResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
CS_AppData.HkPacket.Payload.OneShotInProgress == false) | ||
{ | ||
/* make sure the entry is a valid number and is defined in the table */ | ||
if (CS_GetAppResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CFE_EVS_SendEvent(CS_DISABLE_APP_NAME_INF_EID, CFE_EVS_EventType_INFORMATION, | ||
"Checksumming of app %s is Disabled", Name); | ||
if (CS_GetAppResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CS_AppData.HkPacket.Payload.CmdCounter++; | ||
if (CS_GetAppDefTblEntryByName(&DefinitionEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CFE_EVS_SendEvent(CS_ENABLE_APP_NAME_INF_EID, CFE_EVS_EventType_INFORMATION, | ||
"Checksumming of app %s is Enabled", Name); | ||
if (CS_GetAppResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
CS_AppData.HkPacket.Payload.OneShotInProgress == false) | ||
{ | ||
/* make sure the entry is a valid number and is defined in the table */ | ||
if (CS_GetTableResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CFE_EVS_SendEvent(CS_DISABLE_TABLES_NAME_INF_EID, CFE_EVS_EventType_INFORMATION, | ||
"Checksumming of table %s is Disabled", Name); | ||
if (CS_GetTableResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CS_AppData.HkPacket.Payload.CmdCounter++; | ||
if (CS_GetTableDefTblEntryByName(&DefinitionEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CFE_EVS_SendEvent(CS_ENABLE_TABLES_NAME_INF_EID, CFE_EVS_EventType_INFORMATION, | ||
"Checksumming of table %s is Enabled", Name); | ||
if (CS_GetTableResTblEntryByName(&ResultsEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
|
||
CS_AppData.HkPacket.Payload.CmdCounter++; | ||
if (CS_GetTableDefTblEntryByName(&DefinitionEntry, Name)) |
Check warning
Code scanning / CodeQL
Side effect in a Boolean expression
4b79eaf
to
6f88718
Compare
6f88718
to
951d776
Compare
Checklist
Describe the contribution
Name
variable used in events before being filled in #99strncpy
to fill in theName
variable before theif
block, in order to ensure it is filled in for the final error event as well.Minor changes:
Baseline
variable inCS_ReportBaselineAppCmd
,CS_ReportBaselineEntryIDEepromCmd
,CS_ReportBaselineEntryIDMemoryCmd
andCS_ReportBaselineTablesCmd
only used once in these functions - simplifies to use the value directly and avoid the extra variable (happy to separate out these changes into a separate PR if more suitable).CS_ReportBaselineEntryIDEepromCmd
&CS_ReportBaselineEntryIDEepromCmd
two additional simplifications look reasonable:ResultsEntry
can be removedCS_STATE_UNDEFINED
toState
can be done at initialization, simplifying theif
/else
in the error conditionTesting performed
GitHub CI actions all passing successfully (incl. Build + Run, Unit/Functional Tests etc.).
Expected behavior changes
Name
variable will be filled in in all use-cases.Unnecessary variables are removed, which simplifies the code and eases maintenance/testing.
System(s) tested on
Debian 12 using the current main branch of cFS bundle.
Contributor Info
Avi Weiss @thnkslprpt