(__argz_insert): Use memmove instead of memcpy for possible overlapping strings.

This commit is contained in:
Thomas Bushnell, BSG 1996-07-08 05:37:55 +00:00
parent 28160ffb1c
commit 18e8dd4dbf

View File

@ -51,8 +51,8 @@ __argz_insert (char **argz, size_t *argz_len, char *before, const char *entry)
if (new_argz)
{
before = new_argz + (before - *argz);
memcpy (before + entry_len, before, after_before);
memcpy (before, entry, entry_len);
memmove (before + entry_len, before, after_before);
memmove (before, entry, entry_len);
*argz = new_argz;
*argz_len = new_argz_len;
return 0;