From 59d319ddc39e9016d4e925db3eec00d39b10427d Mon Sep 17 00:00:00 2001 From: drepper Date: Wed, 5 Nov 1997 23:52:49 +0000 Subject: [PATCH] Optimize a bit by using mempcpy. --- string/argz-replace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/string/argz-replace.c b/string/argz-replace.c index 4d658f4713..4540cba58f 100644 --- a/string/argz-replace.c +++ b/string/argz-replace.c @@ -18,6 +18,7 @@ Boston, MA 02111-1307, USA. */ #include +#include #include /* Append BUF, of length BUF_LEN to *TO, of length *TO_LEN, reallocating and @@ -31,8 +32,7 @@ str_append (char **to, size_t *to_len, const char *buf, const size_t buf_len) if (new_to) { - memcpy (new_to + *to_len, buf, buf_len); - new_to[new_len] = '\0'; + *((char *) __mempcpy (new_to + *to_len, buf, buf_len)) = '\0'; *to = new_to; *to_len = new_len; } -- 2.11.0