Avoid -Wstringop-truncation.
libiberty/ChangeLog: * dyn-string.c (dyn_string_insert_cstr): Use memcpy instead of strncpy to avoid -Wstringop-truncation.
This commit is contained in:
parent
d7bd009ab0
commit
445d6db649
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user