PR bootstrap/82948 - prefix.c:202:15: error: 'char* strncpy(char*, const char*,
authorMartin Sebor <msebor@redhat.com>
Sat, 11 Nov 2017 17:43:48 +0000 (17:43 +0000)
committerMartin Sebor <msebor@gcc.gnu.org>
Sat, 11 Nov 2017 17:43:48 +0000 (10:43 -0700)
   size_t)' destination unchanged after copying no bytes

gcc/ChangeLog:

PR bootstrap/82948
* prefic.c (translate_name): Replace strncpy with memcpy to
avoid -Wstringop-truncation.

From-SVN: r254658

gcc/ChangeLog
gcc/prefix.c

index 23f0197..18224e9 100644 (file)
@@ -1,3 +1,9 @@
+2017-11-11  Martin Sebor  <msebor@redhat.com>
+
+       PR bootstrap/82948
+       * prefic.c (translate_name): Replace strncpy with memcpy to
+       avoid -Wstringop-truncation.
+
 2017-11-10  Jan Hubicka  <hubicka@ucw.cz>
 
        * tree-ssa-loop-im.c (execute_sm_if_changed): Do not compute freq_sum.
index b40e9c4..ae09858 100644 (file)
@@ -199,7 +199,7 @@ translate_name (char *name)
        ;
 
       key = (char *) alloca (keylen + 1);
-      strncpy (key, &name[1], keylen);
+      memcpy (key, &name[1], keylen);
       key[keylen] = 0;
 
       if (code == '@')