fts: when there is no risk of overlap, use memcpy, not memmove
authorJim Meyering <meyering@redhat.com>
Tue, 4 Sep 2012 09:31:09 +0000 (11:31 +0200)
committerJim Meyering <meyering@redhat.com>
Tue, 4 Sep 2012 10:42:55 +0000 (12:42 +0200)
* lib/fts.c (fts_alloc): Fix unjustified memmove: s/memmove/memcpy/

ChangeLog
lib/fts.c

index f484d28..d4d2cb1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-04  Jim Meyering  <meyering@redhat.com>
+
+       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  <eggert@cs.ucla.edu>
 
        stdbool: be more compatible with mixed C/C++ compiles
index 42c8067..ce14a80 100644 (file)
--- 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;