Skip to content

Commit

Permalink
Merge pull request #1758 from zanzaben/fix1757_handle_fail_codes_GetT…
Browse files Browse the repository at this point in the history
…ypeFromMsgId

Fix #1757, Handle fail status from internal functions of CFE_MSG_GetT…
  • Loading branch information
astrogeco authored Aug 4, 2021
2 parents bd0f3dd + 6cf2e2f commit a434d6c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions modules/msg/fsw/src/cfe_msg_msgid_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
*-----------------------------------------------------------------*/
CFE_Status_t CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type)
{

CFE_MSG_Message_t msg;
int32 Status;

/* Memset to initialize avoids possible GCC bug 53119 */
memset(&msg, 0, sizeof(msg));
Expand All @@ -46,8 +46,11 @@ CFE_Status_t CFE_MSG_GetTypeFromMsgId(CFE_SB_MsgId_t MsgId, CFE_MSG_Type_t *Type
return CFE_MSG_BAD_ARGUMENT;
}

CFE_MSG_SetMsgId(&msg, MsgId);
CFE_MSG_GetType(&msg, Type);
Status = CFE_MSG_SetMsgId(&msg, MsgId);
if (Status == CFE_SUCCESS)
{
Status = CFE_MSG_GetType(&msg, Type);
}

return CFE_SUCCESS;
return Status;
}

0 comments on commit a434d6c

Please sign in to comment.