diff --git a/libs/port/memmove.c b/libs/port/memmove.c index f8402decfba..7be9638a782 100644 --- a/libs/port/memmove.c +++ b/libs/port/memmove.c @@ -22,25 +22,26 @@ #include "wine/port.h" #ifndef HAVE_MEMMOVE -void *memmove( void *dest, const void *src, size_t len ) +void *memmove( void *dest, const void *source, size_t len ) { register char *dst = dest; + register const char *src = source; /* Use memcpy if not overlapping */ - if ((dst + len <= (char *)src) || ((char *)src + len <= dst)) + if ((dst + len <= src) || (src + len <= dst)) { memcpy( dst, src, len ); } /* Otherwise do it the hard way (FIXME: could do better than this) */ - else if (dst < (char *)src) + else if (dst < src) { - while (len--) *dst++ = *((char *)src)++; + while (len--) *dst++ = *src++; } else { dst += len - 1; - src = (char *)src + len - 1; - while (len--) *dst-- = *((char *)src)--; + src += len - 1; + while (len--) *dst-- = *src--; } return dest; }