Skip to content

Commit

Permalink
sizeof() for GetPipeName calls
Browse files Browse the repository at this point in the history
  • Loading branch information
CDKnightNASA committed Jan 21, 2020
1 parent eafb8ec commit 0e76026
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions fsw/cfe-core/src/sb/cfe_sb_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ int32 CFE_SB_SubscribeFull(CFE_SB_MsgId_t MsgId,
char FullName[(OS_MAX_API_NAME * 2)];
char PipeName[OS_MAX_API_NAME] = {'\0'};

CFE_SB_GetPipeName(PipeName, OS_MAX_API_NAME, PipeId);
CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId);

/* take semaphore to prevent a task switch during this call */
CFE_SB_LockSharedData(__func__,__LINE__);
Expand Down Expand Up @@ -1230,7 +1230,7 @@ int32 CFE_SB_UnsubscribeFull(CFE_SB_MsgId_t MsgId,CFE_SB_PipeId_t PipeId,

CFE_SB_UnlockSharedData(__func__,__LINE__);

CFE_SB_GetPipeName(PipeName, OS_MAX_API_NAME, PipeId);
CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeId);

CFE_EVS_SendEventWithAppID(CFE_SB_UNSUB_NO_SUBS_EID,CFE_EVS_EventType_INFORMATION,CFE_SB.AppId,
"Unsubscribe Err:No subs for Msg 0x%x on %s,app %s",
Expand Down Expand Up @@ -1662,7 +1662,7 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
/* Determine if event can be sent without causing recursive event problem */
if(CFE_SB_RequestToSendEvent(TskId,CFE_SB_MSGID_LIM_ERR_EID_BIT) == CFE_SB_GRANTED){

CFE_SB_GetPipeName(PipeName, OS_MAX_API_NAME, SBSndErr.EvtBuf[i].PipeId);
CFE_SB_GetPipeName(PipeName, sizeof(PipeName), SBSndErr.EvtBuf[i].PipeId);

CFE_ES_PerfLogEntry(CFE_MISSION_SB_MSG_LIM_PERF_ID);
CFE_ES_PerfLogExit(CFE_MISSION_SB_MSG_LIM_PERF_ID);
Expand All @@ -1681,7 +1681,7 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
/* Determine if event can be sent without causing recursive event problem */
if(CFE_SB_RequestToSendEvent(TskId,CFE_SB_Q_FULL_ERR_EID_BIT) == CFE_SB_GRANTED){

CFE_SB_GetPipeName(PipeName, OS_MAX_API_NAME, SBSndErr.EvtBuf[i].PipeId);
CFE_SB_GetPipeName(PipeName, sizeof(PipeName), SBSndErr.EvtBuf[i].PipeId);

CFE_ES_PerfLogEntry(CFE_MISSION_SB_PIPE_OFLOW_PERF_ID);
CFE_ES_PerfLogExit(CFE_MISSION_SB_PIPE_OFLOW_PERF_ID);
Expand All @@ -1700,7 +1700,7 @@ int32 CFE_SB_SendMsgFull(CFE_SB_Msg_t *MsgPtr,
/* Determine if event can be sent without causing recursive event problem */
if(CFE_SB_RequestToSendEvent(TskId,CFE_SB_Q_WR_ERR_EID_BIT) == CFE_SB_GRANTED){

CFE_SB_GetPipeName(PipeName, OS_MAX_API_NAME, SBSndErr.EvtBuf[i].PipeId);
CFE_SB_GetPipeName(PipeName, sizeof(PipeName), SBSndErr.EvtBuf[i].PipeId);

CFE_EVS_SendEventWithAppID(CFE_SB_Q_WR_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Pipe Write Err,MsgId 0x%x,pipe %s,sender %s,stat 0x%x",
Expand Down Expand Up @@ -2330,7 +2330,7 @@ int32 CFE_SB_ReadQueue (CFE_SB_PipeD_t *PipeDscPtr,
CFE_SB.HKTlmMsg.Payload.InternalErrorCounter++;
CFE_SB_UnlockSharedData(__func__,__LINE__);
/* Unexpected error while reading the queue. */
CFE_SB_GetPipeName(PipeName, OS_MAX_API_NAME, PipeDscPtr->PipeId);
CFE_SB_GetPipeName(PipeName, sizeof(PipeName), PipeDscPtr->PipeId);
CFE_EVS_SendEventWithAppID(CFE_SB_Q_RD_ERR_EID,CFE_EVS_EventType_ERROR,CFE_SB.AppId,
"Pipe Read Err,pipe %s,app %s,stat 0x%x",
PipeName,CFE_SB_GetAppTskName(TskId,FullName),(unsigned int)Status);
Expand Down
2 changes: 1 addition & 1 deletion fsw/cfe-core/src/sb/cfe_sb_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ int32 CFE_SB_SendRtgInfo(const char *Filename)
* the buffer, therefore the initialization above will protect for now
*/
CFE_ES_GetAppName(&Entry.AppName[0], pd->AppId, sizeof(Entry.AppName));
CFE_SB_GetPipeName(Entry.PipeName, OS_MAX_API_NAME, Entry.PipeId);
CFE_SB_GetPipeName(Entry.PipeName, sizeof(Entry.PipeName), Entry.PipeId);

WriteStat = OS_write (fd, &Entry, sizeof(CFE_SB_RoutingFileEntry_t));
if(WriteStat != sizeof(CFE_SB_RoutingFileEntry_t)){
Expand Down

0 comments on commit 0e76026

Please sign in to comment.