maint: s/strncpy/memcpy/, when equivalent

* src/output.c (output_skeleton): Use memcpy, not strncpy,
since the source is known to fit in the destination buffer.
* src/parse-gram.y (%skeleton): Likewise.
This commit is contained in:
Jim Meyering
2012-05-05 11:30:01 +02:00
parent 7020e5f050
commit bb3b912b0a
2 changed files with 2 additions and 2 deletions

View File

@@ -322,7 +322,7 @@ prologue_declaration:
xmalloc (dir_length + 1 + strlen (skeleton_user) + 1);
if (dir_length > 0)
{
strncpy (skeleton_build, current_file, dir_length);
memcpy (skeleton_build, current_file, dir_length);
skeleton_build[dir_length++] = '/';
}
strcpy (skeleton_build + dir_length, skeleton_user);