gnustep-dev
[Top][All Lists]
Advanced

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

memmove instead of memcpy


From: Philippe Roussel
Subject: memmove instead of memcpy
Date: Sat, 12 Feb 2011 21:22:29 +0100

Hi,

Are these kind of patches considered useful ?
Documentation says memmove should be used when the memory areas overlap
and valgrind warns about it.

Philippe


Index: base/Source/NSPointerArray.m
===================================================================
--- base/Source/NSPointerArray.m        (révision 32115)
+++ base/Source/NSPointerArray.m        (copie de travail)
@@ -281,7 +281,7 @@
            }
          if (i < _count - 1)
            {
-             memcpy(_contents + j, _contents + i + 1,
+             memmove(_contents + j, _contents + i + 1,
                (_count - i) * sizeof(void*));
            }
          _count = i = j;





reply via email to

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