Skip to content

Clean up strncpy use #1089

@skliper

Description

@skliper

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:

char CDSName[CFE_MISSION_ES_CDS_MAX_FULL_NAME_LEN] = {""};

...
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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions