aboutsummaryrefslogtreecommitdiff
path: root/libiberty
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2021-02-01 08:58:31 -0700
committerMartin Sebor <msebor@redhat.com>2021-02-01 09:00:02 -0700
commit445d6db6490393bcbdbdf2b7dc76a9f1a15402bb (patch)
treeab1441d44919a9684c592ff0c23c14b721957903 /libiberty
parentd7bd009ab00412eaa60719d38b947d3df5c69b02 (diff)
downloadgcc-445d6db6490393bcbdbdf2b7dc76a9f1a15402bb.zip
gcc-445d6db6490393bcbdbdf2b7dc76a9f1a15402bb.tar.gz
gcc-445d6db6490393bcbdbdf2b7dc76a9f1a15402bb.tar.bz2
Avoid -Wstringop-truncation.
libiberty/ChangeLog: * dyn-string.c (dyn_string_insert_cstr): Use memcpy instead of strncpy to avoid -Wstringop-truncation.
Diffstat (limited to 'libiberty')
-rw-r--r--libiberty/dyn-string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libiberty/dyn-string.c b/libiberty/dyn-string.c
index ea71118..8d2456b 100644
--- a/libiberty/dyn-string.c
+++ b/libiberty/dyn-string.c
@@ -277,7 +277,7 @@ dyn_string_insert_cstr (dyn_string_t dest, int pos, const char *src)
for (i = dest->length; i >= pos; --i)
dest->s[i + length] = dest->s[i];
/* Splice in the new stuff. */
- strncpy (dest->s + pos, src, length);
+ memcpy (dest->s + pos, src, length);
/* Compute the new length. */
dest->length += length;
return 1;