]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - lib/string.c
string: Use memcpy() within memmove() when we can
[people/ms/u-boot.git] / lib / string.c
index c1a28c14ced51dd58424a10d2af0e1444207a80a..e94021c4680a118aed754662eb2bf2f0b2e50d4a 100644 (file)
@@ -511,16 +511,9 @@ void * memmove(void * dest,const void *src,size_t count)
 {
        char *tmp, *s;
 
-       if (src == dest)
-               return dest;
-
        if (dest <= src) {
-               tmp = (char *) dest;
-               s = (char *) src;
-               while (count--)
-                       *tmp++ = *s++;
-               }
-       else {
+               memcpy(dest, src, count);
+       } else {
                tmp = (char *) dest + count;
                s = (char *) src + count;
                while (count--)