str_repeat() patch

From: Date: Fri, 11 Jun 2004 14:50:16 +0000
Subject: str_repeat() patch
Groups: php.internals 
Request: Send a blank email to internals+get-10402@lists.php.net to get a copy of this message
Read it: void *memmove(void *s1, const void *s2, size_t n); If s1 and s2 overlap, all bytes are copied in a preserving manner (unlike memcpy()) And anwer the question: are s1 and s2 overlap in the str_repeat() ? Why don't use memcpy() instead of memmove() ? ===========cut=============
--- string.c    Thu May 13 20:44:32 2004
+++ string_str_repeat.c Fri Jun 11 17:40:47 2004 @@ -3581,7 +3581,7 @@
        while (e<ee) {
            l = (e-s) < (ee-e) ? (e-s) : (ee-e);
-           memmove(e, s, l);
+            memcpy(e, s, l);
            e += l;
        }
    }
===========cut============= -- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

« previous php.internals (#10402) next »