-
Notifications
You must be signed in to change notification settings - Fork 228
Description
Is your feature request related to a problem? Please describe.
Still occasionally using hardcoded defines for the character array length. Better to use sizeof to simplify maintenance. Also not always setting last character null.
Example:
cFE/fsw/cfe-core/src/es/cfe_es_api.c
Line 1710 in 1ede295
| char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN] = {""}; |
...
cFE/fsw/cfe-core/src/es/cfe_es_api.c
Lines 1740 to 1741 in 1ede295
| strncpy(CDSName, Name, CFE_MISSION_ES_CDS_MAX_NAME_LENGTH); | |
| CDSName[CFE_MISSION_ES_CDS_MAX_NAME_LENGTH-1] = '\0'; |
Describe the solution you'd like
Use sizeof.
Describe alternatives you've considered
None
Additional context
None
Requester Info
Jacob Hageman - NASA/GSFC