Skip to content

Commit

Permalink
Fix #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 27, 2020
1 parent 3077251 commit 49d93c2
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((char *)AppRecPtr->StartParams.FileName, AppFileName, OS_MAX_PATH_LEN);
strncpy(AppRecPtr->StartParams.FileName, AppFileName,
sizeof(AppRecPtr->StartParams.FileName)-1);
AppRecPtr->StartParams.FileName[sizeof(AppRecPtr->StartParams.FileName)-1] = 0;
AppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD;
}
else
Expand Down

0 comments on commit 49d93c2

Please sign in to comment.