Skip to content

Commit

Permalink
Fix nasa#970, strncpy warning
Browse files Browse the repository at this point in the history
Adjust strncpy call to not trigger warning
  • Loading branch information
jphickey committed Oct 29, 2020
1 parent e0d1ce8 commit 5365480
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 5365480

Please sign in to comment.