Neil Wyper wrote:
:
Your modified memcpy works for most situations, but doesn't handle overlapping arrays properly, if src < dst. If the arrays overlap, then the copy to dst will overwrite the end of src before it is copied. This is why the libc memcopy has a block for "copy backwards" if src < dst.
:

memcpy() does not make any guarantees about averlapping areas. Overlapping areas are a task of memmove().

Hardy


Reply via email to