Skip to content

Commit

Permalink
Fix #1667, CFE_SB_MsgHdrSize returns size_t (#1674)
Browse files Browse the repository at this point in the history
* Fix #1667, CFE_SB_MsgHdrSize returns size_t but still attempts to return CFE status code
  • Loading branch information
oliverhamburger committed Jul 20, 2021
1 parent 162274b commit 38d6515
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions modules/core_api/fsw/inc/cfe_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ void *CFE_SB_GetUserData(CFE_MSG_Message_t *MsgPtr);
** This must point to the first byte of the message header.
**
** \return The size (in bytes) of the user data in the software bus message.
** \retval 0 if an error occurs, such as if the MsgPtr argument is not valid.
**/
size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr);

Expand Down
3 changes: 2 additions & 1 deletion modules/sb/fsw/src/cfe_sb_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ CFE_SB_DestinationD_t *CFE_SB_GetDestPtr(CFE_SBR_RouteId_t RouteId, CFE_SB_PipeI
** if SB messages are implemented as CCSDS packets, the size of the header
** is different for command vs. telemetry packets.
**
** \returns Estimated number of bytes in the message header for the given message
** \returns Estimated number of bytes in the message header for the given message.
** \retval 0 if an error occurs, such as if the MsgPtr argument is not valid or header type cannot be identified.
**/
size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr);

Expand Down
4 changes: 2 additions & 2 deletions modules/sb/fsw/src/cfe_sb_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ size_t CFE_SB_MsgHdrSize(const CFE_MSG_Message_t *MsgPtr)

if (MsgPtr == NULL)
{
return CFE_SB_BAD_ARGUMENT;
return size;
}

CFE_MSG_GetHasSecondaryHeader(MsgPtr, &hassechdr);
Expand Down Expand Up @@ -117,7 +117,7 @@ size_t CFE_SB_GetUserDataLength(const CFE_MSG_Message_t *MsgPtr)

if (MsgPtr == NULL)
{
return CFE_SB_BAD_ARGUMENT;
return TotalMsgSize;
}

CFE_MSG_GetSize(MsgPtr, &TotalMsgSize);
Expand Down

0 comments on commit 38d6515

Please sign in to comment.