libluna: Fix memmove when dest > src

Really? A crucial component of the libc was broken? No wonder some ports did not work very well...
This commit is contained in:
apio 2024-02-11 17:08:36 +01:00
parent 1070c85922
commit 644614cdd8
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -51,7 +51,7 @@ extern "C"
{
if (dest == src) return dest;
if (dest > src)
for (long i = (long)n - 1; i >= 0; i++) { *((u8*)dest + i) = *((const u8*)src + i); }
for (long i = (long)n - 1; i >= 0; i--) { *((u8*)dest + i) = *((const u8*)src + i); }
else
for (long i = 0; i < (long)n; i++) { *((u8*)dest + i) = *((const u8*)src + i); }
return dest;