Skip to content

Commit

Permalink
Fix nasa#140, Adds JSC 2.1 Static Analysis comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jdfiguer authored and jdfiguer committed Jun 14, 2024
1 parent 1805d10 commit 8f7cff9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fsw/src/sc_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ CFE_Status_t SC_AppInit(void)
SC_AppData.TimeRef = SC_LookupTimeAccessor(SC_TIME_TO_USE);

/* Make sure nothing is running */
SC_AppData.NextProcNumber = SC_Process_NONE;
SC_AppData.NextProcNumber = SC_Process_NONE;
/* SAD: SC_Process_ATP is 0, within the valid index range of NextCmdTime array, which has 2 elements */
SC_AppData.NextCmdTime[SC_Process_ATP] = SC_MAX_TIME;
/* SAD: SC_Process_RTP is 1, within the valid index range of NextCmdTime array, which has 2 elements */
SC_AppData.NextCmdTime[SC_Process_RTP] = SC_MAX_TIME;

/* Initialize the SC housekeeping packet */
Expand Down Expand Up @@ -364,6 +366,8 @@ CFE_Status_t SC_RegisterDumpOnlyTables(void)
/* Register dump only ATS command status tables */
for (i = 0; i < SC_NUMBER_OF_ATS; i++)
{
/* SAD: No need to check snprintf return value; TableName's buffer is large enough to safely hold
* SC_ATS_CMD_STAT_TABLE_NAME with the added index */
snprintf(TableName, CFE_MISSION_TBL_MAX_NAME_LENGTH, "%s%d", SC_ATS_CMD_STAT_TABLE_NAME, i + 1);
Result = CFE_TBL_Register(&SC_OperData.AtsCmdStatusHandle[i], TableName, SC_MAX_ATS_CMDS * sizeof(uint32),
TableOptions, NULL);
Expand Down Expand Up @@ -401,6 +405,8 @@ CFE_Status_t SC_RegisterLoadableTables(void)
{
for (j = 0; j < NumTables[i]; j++)
{
/* SAD: No need to check snprintf return value; TableName's buffer is large enough to safely hold
* CFE_MISSION_TBL_MAX_NAME_LENGTH with the added table identifiers */
snprintf(TableName, CFE_MISSION_TBL_MAX_NAME_LENGTH, StrFormat[i], Name[i], j + 1);
Result = CFE_TBL_Register(&TblHandlePtr[i][j], TableName, TableSize[i], TableOptions[i],
TblValidationFuncPtr[i]);
Expand Down

0 comments on commit 8f7cff9

Please sign in to comment.