From acb0726a65e9a6c954adcd50b50d4d02c016de26 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 4 Sep 2012 11:31:09 +0200 Subject: [PATCH] fts: when there is no risk of overlap, use memcpy, not memmove * lib/fts.c (fts_alloc): Fix unjustified memmove: s/memmove/memcpy/ --- ChangeLog | 5 +++++ lib/fts.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f484d28b7..d4d2cb105 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-09-04 Jim Meyering + + fts: when there is no risk of overlap, use memcpy, not memmove + * lib/fts.c (fts_alloc): Fix unjustified memcopy: s/memmove/memcpy/ + 2012-08-29 Paul Eggert stdbool: be more compatible with mixed C/C++ compiles diff --git a/lib/fts.c b/lib/fts.c index 42c806770..ce14a807f 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -1894,7 +1894,7 @@ fts_alloc (FTS *sp, const char *name, register size_t namelen) return (NULL); /* Copy the name and guarantee NUL termination. */ - memmove(p->fts_name, name, namelen); + memcpy(p->fts_name, name, namelen); p->fts_name[namelen] = '\0'; p->fts_namelen = namelen; -- 2.11.0