bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fts: when there is no risk of overlap, use memcpy, not memmove


From: Jim Meyering
Subject: [PATCH] fts: when there is no risk of overlap, use memcpy, not memmove
Date: Tue, 04 Sep 2012 12:21:17 +0200

While investigating the rm-vs-slash-decorated-symlink-to-dir problem,
I noticed this:

>From 9322cc5db3a6efe4c19f274512a28767872384e4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
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 memcopy: s/memmove/memcpy/
---
 ChangeLog | 5 +++++
 lib/fts.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index f484d28..d4d2cb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-04  Jim Meyering  <address@hidden>
+
+       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  <address@hidden>

        stdbool: be more compatible with mixed C/C++ compiles
diff --git a/lib/fts.c b/lib/fts.c
index 42c8067..ce14a80 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;
--
1.7.12.176.g3fc0e4c



reply via email to

[Prev in Thread] Current Thread [Next in Thread]