Skip to content

Commit

Permalink
Merge pull request #89 from chillfig/Add_null_term
Browse files Browse the repository at this point in the history
Fix #83, Adds null termination to software bus messaging
  • Loading branch information
dzbaker authored Mar 10, 2023
2 parents a3bda6e + 5e0a1d9 commit 10a042f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fsw/src/ds_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,8 @@ void DS_CmdSetDestPath(const CFE_SB_Buffer_t *BufPtr)
** Set path portion of destination table filename...
*/
pDest = &DS_AppData.DestFileTblPtr->File[DS_DestPathCmd->FileTableIndex];
strncpy(pDest->Pathname, DS_DestPathCmd->Pathname, sizeof(pDest->Pathname));
CFE_SB_MessageStringGet(pDest->Pathname, DS_DestPathCmd->Pathname, NULL, sizeof(pDest->Pathname),
sizeof(DS_DestPathCmd->Pathname));

/*
** Notify cFE that we have modified the table data...
Expand Down Expand Up @@ -806,7 +807,8 @@ void DS_CmdSetDestBase(const CFE_SB_Buffer_t *BufPtr)
** Set base portion of destination table filename...
*/
pDest = &DS_AppData.DestFileTblPtr->File[DS_DestBaseCmd->FileTableIndex];
strncpy(pDest->Basename, DS_DestBaseCmd->Basename, sizeof(pDest->Basename));
CFE_SB_MessageStringGet(pDest->Basename, DS_DestBaseCmd->Basename, NULL, sizeof(pDest->Basename),
sizeof(DS_DestBaseCmd->Basename));

/*
** Notify cFE that we have modified the table data...
Expand Down Expand Up @@ -873,7 +875,8 @@ void DS_CmdSetDestExt(const CFE_SB_Buffer_t *BufPtr)
** Set extension portion of destination table filename...
*/
pDest = &DS_AppData.DestFileTblPtr->File[DS_DestExtCmd->FileTableIndex];
strncpy(pDest->Extension, DS_DestExtCmd->Extension, sizeof(pDest->Extension));
CFE_SB_MessageStringGet(pDest->Extension, DS_DestExtCmd->Extension, NULL, sizeof(pDest->Extension),
sizeof(DS_DestExtCmd->Extension));

/*
** Notify cFE that we have modified the table data...
Expand Down

0 comments on commit 10a042f

Please sign in to comment.