Skip to content

Commit cd8959b

Browse files
author
Jacob Hageman
committed
Fix #1200, Correct local type for CFE_TBL_FindTableInRegistry returns
1 parent fa10af7 commit cd8959b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

modules/tbl/fsw/src/cfe_tbl_task_cmds.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
360360
CFE_TBL_File_Hdr_t TblFileHeader;
361361
osal_id_t FileDescriptor;
362362
int32 Status;
363+
int16 RegIndex;
363364
CFE_TBL_RegistryRec_t * RegRecPtr;
364365
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
365366
char LoadFilename[OS_MAX_PATH_LEN];
@@ -379,17 +380,17 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_LoadCmd_t *data)
379380
if (Status == CFE_SUCCESS)
380381
{
381382
/* Locate specified table in registry */
382-
Status = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);
383+
RegIndex = CFE_TBL_FindTableInRegistry(TblFileHeader.TableName);
383384

384-
if (Status == CFE_TBL_NOT_FOUND)
385+
if (RegIndex == CFE_TBL_NOT_FOUND)
385386
{
386387
CFE_EVS_SendEvent(CFE_TBL_NO_SUCH_TABLE_ERR_EID, CFE_EVS_EventType_ERROR,
387388
"Unable to locate '%s' in Table Registry", TblFileHeader.TableName);
388389
}
389390
else
390391
{
391392
/* Translate the registry index into a record pointer */
392-
RegRecPtr = &CFE_TBL_Global.Registry[Status];
393+
RegRecPtr = &CFE_TBL_Global.Registry[RegIndex];
393394

394395
if (RegRecPtr->DumpOnly)
395396
{
@@ -1321,7 +1322,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDSCmd_t *data)
13211322
char TableName[CFE_TBL_MAX_FULL_NAME_LEN];
13221323
CFE_TBL_CritRegRec_t * CritRegRecPtr = NULL;
13231324
uint32 i;
1324-
uint32 RegIndex;
1325+
int16 RegIndex;
13251326
int32 Status;
13261327

13271328
/* Make sure all strings are null terminated before attempting to process them */

modules/tbl/ut-coverage/tbl_UT.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2589,7 +2589,7 @@ void Test_CFE_TBL_Manage(void)
25892589
{
25902590
int32 RtnCode;
25912591
bool EventsCorrect;
2592-
int32 RegIndex;
2592+
int16 RegIndex;
25932593
CFE_TBL_RegistryRec_t * RegRecPtr;
25942594
CFE_TBL_LoadBuff_t * WorkingBufferPtr;
25952595
UT_Table1_t TestTable1;

0 commit comments

Comments
 (0)