Skip to content

Commit

Permalink
Merge pull request #971 from jphickey/fix-970-strncpy-warning
Browse files Browse the repository at this point in the history
Fix #970, strncpy warning
  • Loading branch information
astrogeco authored Nov 2, 2020
2 parents 6a854e6 + 5365480 commit 180559b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fsw/cfe-core/src/es/cfe_es_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,9 @@ int32 CFE_ES_ReloadApp(CFE_ES_ResourceID_t AppID, const char *AppFileName)
{
CFE_ES_SysLogWrite_Unsync("CFE_ES_ReloadApp: Reload Application %s Initiated. New filename = %s\n",
CFE_ES_AppRecordGetName(AppRecPtr), AppFileName);
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName, OS_MAX_PATH_LEN);
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName,
sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1);
AppRecPtr->StartParams.BasicInfo.FileName[sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1] = 0;
AppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD;
}
else
Expand Down

0 comments on commit 180559b

Please sign in to comment.