projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d7bd009
)
Avoid -Wstringop-truncation.
author
Martin Sebor
<msebor@redhat.com>
Mon, 1 Feb 2021 15:58:31 +0000
(08:58 -0700)
committer
Martin Sebor
<msebor@redhat.com>
Mon, 1 Feb 2021 16:00:02 +0000
(09:00 -0700)
libiberty/ChangeLog:
* dyn-string.c (dyn_string_insert_cstr): Use memcpy instead of strncpy
to avoid -Wstringop-truncation.
libiberty/dyn-string.c
patch
|
blob
|
history
diff --git
a/libiberty/dyn-string.c
b/libiberty/dyn-string.c
index ea711182ca576ad186e2455ac4c9c1e1e13b27d0..8d2456b86c81ef5ad00bc4b4ac14b4bb1e711b19 100644
(file)
--- 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. */
-
strn
cpy (dest->s + pos, src, length);
+
mem
cpy (dest->s + pos, src, length);
/* Compute the new length. */
dest->length += length;
return 1;