Read your memcpy manpages

"The  memcpy() function copies n bytes from memory area src to memory
       area dest.  The memory areas may not overlap."

Ilia

On June 11, 2004 10:50 am, Alexander Valyalkin wrote:
> 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/

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to