mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 00:33:03 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user