Skip to content

Commit 5365480

Browse files
committed
Fix #970, strncpy warning
Adjust strncpy call to not trigger warning
1 parent e0d1ce8 commit 5365480

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fsw/cfe-core/src/es/cfe_es_api.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,9 @@ int32 CFE_ES_ReloadApp(CFE_ES_ResourceID_t AppID, const char *AppFileName)
256256
{
257257
CFE_ES_SysLogWrite_Unsync("CFE_ES_ReloadApp: Reload Application %s Initiated. New filename = %s\n",
258258
CFE_ES_AppRecordGetName(AppRecPtr), AppFileName);
259-
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName, OS_MAX_PATH_LEN);
259+
strncpy(AppRecPtr->StartParams.BasicInfo.FileName, AppFileName,
260+
sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1);
261+
AppRecPtr->StartParams.BasicInfo.FileName[sizeof(AppRecPtr->StartParams.BasicInfo.FileName)-1] = 0;
260262
AppRecPtr->ControlReq.AppControlRequest = CFE_ES_RunStatus_SYS_RELOAD;
261263
}
262264
else

0 commit comments

Comments
 (0)