aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2017-11-11 17:43:48 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2017-11-11 10:43:48 -0700
commit42c544b0356f01207f596fcb5a07e04fd3f61e71 (patch)
tree448f61aafe12c45fc965b255e7c31e604b67326a
parentaead609fc1ad1dae117973dce7fd2a5ff196cec3 (diff)
downloadgcc-42c544b0356f01207f596fcb5a07e04fd3f61e71.zip
gcc-42c544b0356f01207f596fcb5a07e04fd3f61e71.tar.gz
gcc-42c544b0356f01207f596fcb5a07e04fd3f61e71.tar.bz2
PR bootstrap/82948 - prefix.c:202:15: error: 'char* strncpy(char*, const char*,
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
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/prefix.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 23f0197..18224e9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/prefix.c b/gcc/prefix.c
index b40e9c4..ae09858 100644
--- a/gcc/prefix.c
+++ b/gcc/prefix.c
@@ -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 == '@')