diff --git a/fsw/cfe-core/src/es/cfe_es_api.c b/fsw/cfe-core/src/es/cfe_es_api.c index cb5545ca0..a27c32376 100644 --- a/fsw/cfe-core/src/es/cfe_es_api.c +++ b/fsw/cfe-core/src/es/cfe_es_api.c @@ -1763,7 +1763,7 @@ int32 CFE_ES_RegisterCDS(CFE_ES_CDSHandle_t *CDSHandlePtr, CFE_ES_CDS_Offset_t B if (Status < 0) { /* Translate AppID of caller into App Name */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_EVS_SendEventWithAppID(CFE_ES_CDS_REGISTER_ERR_EID, CFE_EVS_EventType_ERROR, diff --git a/fsw/cfe-core/src/es/cfe_es_cds.c b/fsw/cfe-core/src/es/cfe_es_cds.c index be9efc862..618e379a4 100644 --- a/fsw/cfe-core/src/es/cfe_es_cds.c +++ b/fsw/cfe-core/src/es/cfe_es_cds.c @@ -668,7 +668,7 @@ void CFE_ES_FormCDSName(char *FullCDSName, const char *CDSName, CFE_ES_ResourceI { char AppName[OS_MAX_API_NAME]; - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); /* Ensure that AppName is null terminated */ AppName[OS_MAX_API_NAME-1] = '\0'; diff --git a/fsw/cfe-core/src/es/cfe_es_perf.c b/fsw/cfe-core/src/es/cfe_es_perf.c index c85a22555..6fce91de9 100644 --- a/fsw/cfe-core/src/es/cfe_es_perf.c +++ b/fsw/cfe-core/src/es/cfe_es_perf.c @@ -229,7 +229,8 @@ int32 CFE_ES_StopPerfDataCmd(const CFE_ES_StopPerfData_t *data) /* Copy out the string, using default if unspecified */ CFE_SB_MessageStringGet(PerfDumpState->DataFileName, CmdPtr->DataFileName, - CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME, OS_MAX_PATH_LEN, sizeof(CmdPtr->DataFileName)); + CFE_PLATFORM_ES_DEFAULT_PERF_DUMP_FILENAME, + sizeof(PerfDumpState->DataFileName), sizeof(CmdPtr->DataFileName)); PerfDumpState->PendingState = CFE_ES_PerfDumpState_INIT; CFE_ES_BackgroundWakeup(); diff --git a/fsw/cfe-core/src/es/cfe_es_task.c b/fsw/cfe-core/src/es/cfe_es_task.c index 75af1e6e9..5f1f6e5dd 100644 --- a/fsw/cfe-core/src/es/cfe_es_task.c +++ b/fsw/cfe-core/src/es/cfe_es_task.c @@ -867,13 +867,13 @@ int32 CFE_ES_StartAppCmd(const CFE_ES_StartApp_t *data) /* Create local copies of all input strings and ensure null termination */ FilenameLen = CFE_SB_MessageStringGet(LocalFile, (char *)cmd->AppFileName, NULL, - OS_MAX_PATH_LEN, sizeof(cmd->AppFileName)); + sizeof(LocalFile), sizeof(cmd->AppFileName)); AppEntryLen = CFE_SB_MessageStringGet(LocalEntryPt, (char *)cmd->AppEntryPoint, NULL, - OS_MAX_API_NAME, sizeof(cmd->AppEntryPoint)); + sizeof(LocalEntryPt), sizeof(cmd->AppEntryPoint)); AppNameLen = CFE_SB_MessageStringGet(LocalAppName, (char *)cmd->Application, NULL, - OS_MAX_API_NAME, sizeof(cmd->Application)); + sizeof(LocalAppName), sizeof(cmd->Application)); /* ** Verify command parameters @@ -968,7 +968,8 @@ int32 CFE_ES_StopAppCmd(const CFE_ES_StopApp_t *data) CFE_ES_ResourceID_t AppID; int32 Result; - CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, OS_MAX_API_NAME, sizeof(cmd->Application)); + CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, + sizeof(LocalApp), sizeof(cmd->Application)); Result = CFE_ES_GetAppIDByName(&AppID, LocalApp); @@ -1021,7 +1022,8 @@ int32 CFE_ES_RestartAppCmd(const CFE_ES_RestartApp_t *data) CFE_ES_ResourceID_t AppID; int32 Result; - CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, OS_MAX_API_NAME, sizeof(cmd->Application)); + CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, + sizeof(LocalApp), sizeof(cmd->Application)); Result = CFE_ES_GetAppIDByName(&AppID, LocalApp); @@ -1071,8 +1073,10 @@ int32 CFE_ES_ReloadAppCmd(const CFE_ES_ReloadApp_t *data) CFE_ES_ResourceID_t AppID; int32 Result; - CFE_SB_MessageStringGet(LocalFileName, (char *)cmd->AppFileName, NULL, sizeof(LocalFileName), sizeof(cmd->AppFileName)); - CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, sizeof(LocalApp), sizeof(cmd->Application)); + CFE_SB_MessageStringGet(LocalFileName, (char *)cmd->AppFileName, NULL, + sizeof(LocalFileName), sizeof(cmd->AppFileName)); + CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, + sizeof(LocalApp), sizeof(cmd->Application)); Result = CFE_ES_GetAppIDByName(&AppID, LocalApp); @@ -1122,7 +1126,8 @@ int32 CFE_ES_QueryOneCmd(const CFE_ES_QueryOne_t *data) CFE_ES_ResourceID_t ResourceID; int32 Result; - CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, OS_MAX_API_NAME, sizeof(cmd->Application)); + CFE_SB_MessageStringGet(LocalApp, (char *)cmd->Application, NULL, + sizeof(LocalApp), sizeof(cmd->Application)); Result = CFE_ES_GetAppIDByName(&ResourceID, LocalApp); if (Result == CFE_ES_ERR_NAME_NOT_FOUND) @@ -1196,8 +1201,8 @@ int32 CFE_ES_QueryAllCmd(const CFE_ES_QueryAll_t *data) /* ** Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(QueryAllFilename, (char *)CmdPtr->FileName, - CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE, OS_MAX_PATH_LEN, sizeof(CmdPtr->FileName)); + CFE_SB_MessageStringGet(QueryAllFilename, (char *)CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_APP_LOG_FILE, + sizeof(QueryAllFilename), sizeof(CmdPtr->FileName)); /* * Collect list of active resource IDs. @@ -1354,8 +1359,8 @@ int32 CFE_ES_QueryAllTasksCmd(const CFE_ES_QueryAllTasks_t *data) /* ** Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ - CFE_SB_MessageStringGet(QueryAllFilename, (char *)CmdPtr->FileName, - CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE, OS_MAX_PATH_LEN, sizeof(CmdPtr->FileName)); + CFE_SB_MessageStringGet(QueryAllFilename, (char *)CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_TASK_LOG_FILE, + sizeof(QueryAllFilename), sizeof(CmdPtr->FileName)); /* * Collect list of active task IDs. @@ -1548,8 +1553,8 @@ int32 CFE_ES_WriteSyslogCmd(const CFE_ES_WriteSyslog_t *data) int32 Stat; char LogFilename[OS_MAX_PATH_LEN]; - CFE_SB_MessageStringGet(LogFilename, (char *)CmdPtr->FileName, - CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE, OS_MAX_PATH_LEN, sizeof(CmdPtr->FileName)); + CFE_SB_MessageStringGet(LogFilename, (char *)CmdPtr->FileName, CFE_PLATFORM_ES_DEFAULT_SYSLOG_FILE, + sizeof(LogFilename), sizeof(CmdPtr->FileName)); Stat = CFE_ES_SysLogDump(LogFilename); @@ -1730,7 +1735,7 @@ int32 CFE_ES_DeleteCDSCmd(const CFE_ES_DeleteCDS_t *data) char LocalCdsName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN]; CFE_SB_MessageStringGet(LocalCdsName, (char *)cmd->CdsName, NULL, - CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN, sizeof(cmd->CdsName)); + sizeof(LocalCdsName), sizeof(cmd->CdsName)); Status = CFE_ES_DeleteCDS(LocalCdsName, false); @@ -1847,7 +1852,7 @@ int32 CFE_ES_DumpCDSRegistryCmd(const CFE_ES_DumpCDSRegistry_t *data) /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ CFE_SB_MessageStringGet(DumpFilename, CmdPtr->DumpFilename, CFE_PLATFORM_ES_DEFAULT_CDS_REG_DUMP_FILE, - OS_MAX_PATH_LEN, sizeof(CmdPtr->DumpFilename)); + sizeof(DumpFilename), sizeof(CmdPtr->DumpFilename)); /* Create a new dump file, overwriting anything that may have existed previously */ Status = OS_OpenCreate(&FileDescriptor, DumpFilename, diff --git a/fsw/cfe-core/src/evs/cfe_evs_log.c b/fsw/cfe-core/src/evs/cfe_evs_log.c index 28519d7bd..e6c091203 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_log.c +++ b/fsw/cfe-core/src/evs/cfe_evs_log.c @@ -169,7 +169,7 @@ int32 CFE_EVS_WriteLogDataFileCmd(const CFE_EVS_WriteLogDataFile_t *data) { /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ CFE_SB_MessageStringGet(LogFilename, (const char *)CmdPtr->LogFilename, CFE_PLATFORM_EVS_DEFAULT_LOG_FILE, - OS_MAX_PATH_LEN, sizeof(CmdPtr->LogFilename)); + sizeof(LogFilename), sizeof(CmdPtr->LogFilename)); /* Create the log file */ Result = OS_OpenCreate(&LogFileHandle, LogFilename, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); diff --git a/fsw/cfe-core/src/evs/cfe_evs_task.c b/fsw/cfe-core/src/evs/cfe_evs_task.c index e5baec3cb..3af348273 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_task.c +++ b/fsw/cfe-core/src/evs/cfe_evs_task.c @@ -786,7 +786,8 @@ int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilter_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1116,7 +1117,8 @@ int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventType_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retrieve application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1190,7 +1192,8 @@ int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventType_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1263,7 +1266,8 @@ int32 CFE_EVS_EnableAppEventsCmd(const CFE_EVS_EnableAppEvents_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retrieve application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1321,7 +1325,8 @@ int32 CFE_EVS_DisableAppEventsCmd(const CFE_EVS_DisableAppEvents_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1380,7 +1385,8 @@ int32 CFE_EVS_ResetAppCounterCmd(const CFE_EVS_ResetAppCounter_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1440,7 +1446,8 @@ int32 CFE_EVS_ResetFilterCmd(const CFE_EVS_ResetFilter_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1513,7 +1520,8 @@ int32 CFE_EVS_ResetAllFiltersCmd(const CFE_EVS_ResetAllFilters_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1575,7 +1583,8 @@ int32 CFE_EVS_AddEventFilterCmd(const CFE_EVS_AddEventFilter_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1667,7 +1676,8 @@ int32 CFE_EVS_DeleteEventFilterCmd(const CFE_EVS_DeleteEventFilter_t *data) * Althgouh EVS_GetApplicationInfo() does not require a null terminated argument, * the value is passed to EVS_SendEvent which does require termination (normal C string) */ - CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, OS_MAX_API_NAME, sizeof(CmdPtr->AppName)); + CFE_SB_MessageStringGet(LocalName, (char *)CmdPtr->AppName, NULL, + sizeof(LocalName), sizeof(CmdPtr->AppName)); /* Retreive application data */ Status = EVS_GetApplicationInfo(&AppDataPtr, LocalName); @@ -1747,7 +1757,7 @@ int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFile_t *data) /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ CFE_SB_MessageStringGet(LocalName, CmdPtr->AppDataFilename, CFE_PLATFORM_EVS_DEFAULT_APP_DATA_FILE, - OS_MAX_PATH_LEN, sizeof(CmdPtr->AppDataFilename)); + sizeof(LocalName), sizeof(CmdPtr->AppDataFilename)); /* Create Application Data File */ Result = OS_OpenCreate(&FileHandle, LocalName, OS_FILE_FLAG_CREATE | OS_FILE_FLAG_TRUNCATE, OS_WRITE_ONLY); @@ -1781,7 +1791,8 @@ int32 CFE_EVS_WriteAppDataFileCmd(const CFE_EVS_WriteAppDataFile_t *data) memset(&AppDataFile, 0, sizeof(CFE_EVS_AppDataFile_t)); /* Copy application data to application file data record */ - CFE_ES_GetAppName(AppDataFile.AppName, EVS_AppDataGetID(AppDataPtr), OS_MAX_API_NAME); + CFE_ES_GetAppName(AppDataFile.AppName, EVS_AppDataGetID(AppDataPtr), + sizeof(AppDataFile.AppName)); AppDataFile.ActiveFlag = AppDataPtr->ActiveFlag; AppDataFile.EventCount = AppDataPtr->EventCount; AppDataFile.EventTypesActiveFlag = AppDataPtr->EventTypesActiveFlag; diff --git a/fsw/cfe-core/src/evs/cfe_evs_utils.c b/fsw/cfe-core/src/evs/cfe_evs_utils.c index 906d808b0..905df42eb 100644 --- a/fsw/cfe-core/src/evs/cfe_evs_utils.c +++ b/fsw/cfe-core/src/evs/cfe_evs_utils.c @@ -194,7 +194,7 @@ int32 EVS_NotRegistered (EVS_AppData_t *AppDataPtr, CFE_ES_ResourceID_t CallerID AppDataPtr->UnregAppID = CallerID; /* Get the name of the "not registered" app */ - CFE_ES_GetAppName(AppName, CallerID, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, CallerID, sizeof(AppName)); /* Send the "not registered" event */ EVS_SendEvent(CFE_EVS_ERR_UNREGISTERED_EVS_APP, CFE_EVS_EventType_ERROR, @@ -300,7 +300,7 @@ bool EVS_IsFiltered (EVS_AppData_t *AppDataPtr, uint16 EventID, uint16 EventType /* Is it time to lock this filter? */ if (FilterPtr->Count == CFE_EVS_MAX_FILTER_COUNT) { - CFE_ES_GetAppName(AppName, EVS_AppDataGetID(AppDataPtr), OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, EVS_AppDataGetID(AppDataPtr), sizeof(AppName)); EVS_SendEvent(CFE_EVS_FILTER_MAX_EID, CFE_EVS_EventType_INFORMATION, "Max filter count reached, AppName = %s, EventID = 0x%08x: Filter locked until reset", diff --git a/fsw/cfe-core/src/sb/cfe_sb_api.c b/fsw/cfe-core/src/sb/cfe_sb_api.c index 736fac134..e700846ed 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_api.c +++ b/fsw/cfe-core/src/sb/cfe_sb_api.c @@ -103,7 +103,7 @@ int32 CFE_SB_CreatePipe(CFE_SB_PipeId_t *PipeIdPtr, uint16 Depth, const char * CFE_ES_GetTaskID(&TskId); /* get callers name */ - CFE_ES_GetAppName(AppName, AppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, AppId, sizeof(AppName)); /* Hardcode a NULL terminator, in case rcvd name was too long */ AppName[OS_MAX_API_NAME-1]= '\0'; diff --git a/fsw/cfe-core/src/sb/cfe_sb_task.c b/fsw/cfe-core/src/sb/cfe_sb_task.c index 97c587186..2063ee296 100644 --- a/fsw/cfe-core/src/sb/cfe_sb_task.c +++ b/fsw/cfe-core/src/sb/cfe_sb_task.c @@ -783,7 +783,7 @@ int32 CFE_SB_SendRoutingInfoCmd(const CFE_SB_SendRoutingInfo_t *data) ptr = &data->Payload; CFE_SB_MessageStringGet(LocalFilename, ptr->Filename, CFE_PLATFORM_SB_DEFAULT_ROUTING_FILENAME, - OS_MAX_PATH_LEN, sizeof(ptr->Filename)); + sizeof(LocalFilename), sizeof(ptr->Filename)); Stat = CFE_SB_SendRtgInfo(LocalFilename); CFE_SB_IncrCmdCtr(Stat); @@ -813,7 +813,7 @@ int32 CFE_SB_SendPipeInfoCmd(const CFE_SB_SendPipeInfo_t *data) ptr = &data->Payload; CFE_SB_MessageStringGet(LocalFilename, ptr->Filename, CFE_PLATFORM_SB_DEFAULT_PIPE_FILENAME, - OS_MAX_PATH_LEN, sizeof(ptr->Filename)); + sizeof(LocalFilename), sizeof(ptr->Filename)); Stat = CFE_SB_SendPipeInfo(LocalFilename); CFE_SB_IncrCmdCtr(Stat); @@ -843,7 +843,7 @@ int32 CFE_SB_SendMapInfoCmd(const CFE_SB_SendMapInfo_t *data) ptr = &data->Payload; CFE_SB_MessageStringGet(LocalFilename, ptr->Filename, CFE_PLATFORM_SB_DEFAULT_MAP_FILENAME, - OS_MAX_PATH_LEN, sizeof(ptr->Filename)); + sizeof(LocalFilename), sizeof(ptr->Filename)); Stat = CFE_SB_SendMapInfo(LocalFilename); diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_api.c b/fsw/cfe-core/src/tbl/cfe_tbl_api.c index b28e72232..22765e8d5 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_api.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_api.c @@ -368,7 +368,7 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, /* possible at this point during table registration. But we */ /* do need to handle the error case because if the function */ /* call did fail, WorkingBufferPtr would be a NULL pointer. */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_ES_WriteToSysLog("CFE_TBL:Register-Failed to get work buffer for '%s.%s' (ErrCode=0x%08X)\n", AppName, Name, (unsigned int)Status); } @@ -379,7 +379,7 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, if (Status != CFE_SUCCESS) { - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_ES_WriteToSysLog("CFE_TBL:Register-Failed to recover '%s.%s' from CDS (ErrCode=0x%08X)\n", AppName, Name, (unsigned int)Status); } @@ -422,7 +422,7 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, { /* If an error occurred while trying to get the previous contents registry info, */ /* Log the error in the System Log and pretend like we created a new CDS */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_ES_WriteToSysLog("CFE_TBL:Register-Failed to recover '%s.%s' info from CDS TblReg\n", AppName, Name); Status = CFE_SUCCESS; @@ -490,7 +490,7 @@ int32 CFE_TBL_Register( CFE_TBL_Handle_t *TblHandlePtr, *TblHandlePtr = CFE_TBL_BAD_TABLE_HANDLE; /* Translate AppID of caller into App Name */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_EVS_SendEventWithAppID(CFE_TBL_REGISTER_ERR_EID, CFE_EVS_EventType_ERROR, @@ -589,7 +589,7 @@ int32 CFE_TBL_Share( CFE_TBL_Handle_t *TblHandlePtr, if (Status < 0) { /* Translate AppID of caller into App Name */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_EVS_SendEventWithAppID(CFE_TBL_SHARE_ERR_EID, CFE_EVS_EventType_ERROR, @@ -653,7 +653,7 @@ int32 CFE_TBL_Unregister ( CFE_TBL_Handle_t TblHandle ) if (Status < 0) { /* Translate AppID of caller into App Name */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); CFE_EVS_SendEventWithAppID(CFE_TBL_UNREGISTER_ERR_EID, CFE_EVS_EventType_ERROR, @@ -702,7 +702,7 @@ int32 CFE_TBL_Load( CFE_TBL_Handle_t TblHandle, RegRecPtr = &CFE_TBL_TaskData.Registry[AccessDescPtr->RegIndex]; /* Translate AppID of caller into App Name */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); /* Initialize return pointer to NULL */ WorkingBufferPtr = NULL; @@ -941,7 +941,7 @@ int32 CFE_TBL_Update( CFE_TBL_Handle_t TblHandle ) if (Status != CFE_TBL_ERR_BAD_APP_ID) { /* Translate AppID of caller into App Name */ - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); } /* On Error conditions, notify ground of screw up */ @@ -1142,7 +1142,7 @@ int32 CFE_TBL_Validate( CFE_TBL_Handle_t TblHandle ) AccessDescPtr = &CFE_TBL_TaskData.Handles[TblHandle]; RegRecPtr = &CFE_TBL_TaskData.Registry[AccessDescPtr->RegIndex]; - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); /* Identify the image to be validated, starting with the Inactive Buffer */ if (RegRecPtr->ValidateInactiveIndex != CFE_TBL_NO_VALIDATION_PENDING) diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c b/fsw/cfe-core/src/tbl/cfe_tbl_internal.c index d5334759d..e7b861fe8 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_internal.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_internal.c @@ -156,7 +156,7 @@ int32 CFE_TBL_EarlyInit (void) /* Initialize memory partition and allocate shared table buffers. */ Status = CFE_ES_PoolCreate(&CFE_TBL_TaskData.Buf.PoolHdl, CFE_TBL_TaskData.Buf.Partition.Data, - CFE_PLATFORM_TBL_BUF_MEMORY_BYTES); + sizeof(CFE_TBL_TaskData.Buf.Partition)); if(Status < 0) { @@ -682,7 +682,7 @@ void CFE_TBL_FormTableName(char *FullTblName, const char *TblName, CFE_ES_Resour { char AppName[OS_MAX_API_NAME]; - CFE_ES_GetAppName(AppName, ThisAppId, OS_MAX_API_NAME); + CFE_ES_GetAppName(AppName, ThisAppId, sizeof(AppName)); /* Ensure that AppName is null terminated */ AppName[OS_MAX_API_NAME-1] = '\0'; diff --git a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c index 39048e696..b9a0b5104 100644 --- a/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c +++ b/fsw/cfe-core/src/tbl/cfe_tbl_task_cmds.c @@ -382,7 +382,7 @@ int32 CFE_TBL_LoadCmd(const CFE_TBL_Load_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(LoadFilename, (char *)CmdPtr->LoadFilename, NULL, - OS_MAX_PATH_LEN, sizeof(CmdPtr->LoadFilename)); + sizeof(LoadFilename), sizeof(CmdPtr->LoadFilename)); /* Try to open the specified table file */ Status = OS_OpenCreate(&FileDescriptor, LoadFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); @@ -588,10 +588,10 @@ int32 CFE_TBL_DumpCmd(const CFE_TBL_Dump_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(DumpFilename, (char *)CmdPtr->DumpFilename, NULL, - OS_MAX_PATH_LEN, sizeof(CmdPtr->DumpFilename)); + sizeof(DumpFilename), sizeof(CmdPtr->DumpFilename)); CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, - CFE_TBL_MAX_FULL_NAME_LEN, sizeof(CmdPtr->TableName)); + sizeof(TableName), sizeof(CmdPtr->TableName)); /* Before doing anything, lets make sure the table that is to be dumped exists */ RegIndex = CFE_TBL_FindTableInRegistry(TableName); @@ -878,7 +878,7 @@ int32 CFE_TBL_ValidateCmd(const CFE_TBL_Validate_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, - CFE_TBL_MAX_FULL_NAME_LEN, sizeof(CmdPtr->TableName)); + sizeof(TableName), sizeof(CmdPtr->TableName)); /* Before doing anything, lets make sure the table that is to be dumped exists */ RegIndex = CFE_TBL_FindTableInRegistry(TableName); @@ -1034,7 +1034,7 @@ int32 CFE_TBL_ActivateCmd(const CFE_TBL_Activate_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, - CFE_TBL_MAX_FULL_NAME_LEN, sizeof(CmdPtr->TableName)); + sizeof(TableName), sizeof(CmdPtr->TableName)); /* Before doing anything, lets make sure the table that is to be dumped exists */ RegIndex = CFE_TBL_FindTableInRegistry(TableName); @@ -1133,7 +1133,7 @@ int32 CFE_TBL_DumpRegistryCmd(const CFE_TBL_DumpRegistry_t *data) /* Copy the commanded filename into local buffer to ensure size limitation and to allow for modification */ CFE_SB_MessageStringGet(DumpFilename, (char *)CmdPtr->DumpFilename, CFE_PLATFORM_TBL_DEFAULT_REG_DUMP_FILE, - OS_MAX_PATH_LEN, sizeof(CmdPtr->DumpFilename)); + sizeof(DumpFilename), sizeof(CmdPtr->DumpFilename)); /* Check to see if the dump file already exists */ Status = OS_OpenCreate(&FileDescriptor, DumpFilename, OS_FILE_FLAG_NONE, OS_READ_ONLY); @@ -1310,7 +1310,7 @@ int32 CFE_TBL_SendRegistryCmd(const CFE_TBL_SendRegistry_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, - CFE_TBL_MAX_FULL_NAME_LEN, sizeof(CmdPtr->TableName)); + sizeof(TableName), sizeof(CmdPtr->TableName)); /* Before doing anything, lets make sure the table registry entry that is to be telemetered exists */ RegIndex = CFE_TBL_FindTableInRegistry(TableName); @@ -1360,7 +1360,7 @@ int32 CFE_TBL_DeleteCDSCmd(const CFE_TBL_DeleteCDS_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, - CFE_TBL_MAX_FULL_NAME_LEN, sizeof(CmdPtr->TableName)); + sizeof(TableName), sizeof(CmdPtr->TableName)); /* Before doing anything, lets make sure the table is no longer in the registry */ /* This would imply that the owning application has been terminated and that it */ @@ -1456,7 +1456,7 @@ int32 CFE_TBL_AbortLoadCmd(const CFE_TBL_AbortLoad_t *data) /* Make sure all strings are null terminated before attempting to process them */ CFE_SB_MessageStringGet(TableName, (char *)CmdPtr->TableName, NULL, - CFE_TBL_MAX_FULL_NAME_LEN, sizeof(CmdPtr->TableName)); + sizeof(TableName), sizeof(CmdPtr->TableName)); /* Before doing anything, lets make sure the table registry entry that is to be telemetered exists */ RegIndex = CFE_TBL_FindTableInRegistry(TableName);