Skip to content

Commit

Permalink
Fix #1200, Correct local type for CFE_TBL_FindTableInRegistry returns
Browse files Browse the repository at this point in the history
  • Loading branch information
skliper committed Mar 17, 2021
1 parent fa10af7 commit cd8959b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions modules/tbl/fsw/src/cfe_tbl_task_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
CFE_TBL_File_Hdr_t TblFileHeader;
osal_id_t FileDescriptor;
int32 Status;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
char LoadFilename[OS_MAX_PATH_LEN];
Expand All @@ -379,17 +380,17 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
if (Status == CFE_SUCCESS)
{
/* Locate specified table in registry */
Status = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);
RegIndex = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);

if (Status == CFE_TBL_NOT_FOUND)
if (RegIndex == CFE_TBL_NOT_FOUND)
{
CFE_EVS_SendEvent(CFE_TBL_NO_SUCH_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
"Unable to locate '%s' in Table Registry", TblFileHeader.TableName);
}
else
{
/* Translate the registry index into a record pointer */
RegRecPtr = &CFE_TBL_Global.Registry[Status];
RegRecPtr = &CFE_TBL_Global.Registry[RegIndex];

if (RegRecPtr->DumpOnly)
{
Expand Down Expand Up @@ -1321,7 +1322,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data)
char TableName[CFE_TBL_MAX_FULL_NAME_LEN];
CFE_TBL_CritRegRec_t * CritRegRecPtr = NULL;
uint32 i;
uint32 RegIndex;
int16 RegIndex;
int32 Status;

/* Make sure all strings are null terminated before attempting to process them */
Expand Down
2 changes: 1 addition & 1 deletion modules/tbl/ut-coverage/tbl_UT.c
Original file line number Diff line number Diff line change
Expand Up @@ -2589,7 +2589,7 @@ void Test_CFE_TBL_Manage(void)
{
int32 RtnCode;
bool EventsCorrect;
int32 RegIndex;
int16 RegIndex;
CFE_TBL_RegistryRec_t * RegRecPtr;
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
UT_Table1_t TestTable1;
Expand Down

0 comments on commit cd8959b

Please sign in to comment.