Skip to content
Snippets Groups Projects
Commit 2751d761 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Change strncpy to strncat so it becomes clear that input truncation is intended.

parent ce1425fb
No related branches found
No related tags found
No related merge requests found
......@@ -331,7 +331,8 @@ void zaxisGetString(char *name, const char *zaxisstrname, size_t len)
size_t slen = strlen(zaxisstrname)+1;
if ( slen > len ) slen = len;
if ( slen > CDI_MAX_NAME ) slen = CDI_MAX_NAME;
strncpy(name, zaxisstrname, slen);
name[0] = 0;
strncat(name, zaxisstrname, slen);
name[slen-1] = 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment