diff --git a/src/string.c b/src/string.c index d4f20f7..b6dbf53 100644 --- a/src/string.c +++ b/src/string.c @@ -12,7 +12,6 @@ void *memcpy(void *restrict s1, const void *restrict s2, size_t n) { void *memmove(void *s1, const void *s2, size_t n) { u8* c1 = s1; const u8* c2 = s2; - // Note(bumbread): shouldn't this be backwards? if (c1 != c2) { if (c1 < c2) { // reverse copy diff --git a/test/stuff.c b/test/stuff.c new file mode 100644 index 0000000..bc872ad --- /dev/null +++ b/test/stuff.c @@ -0,0 +1,13 @@ + +#include +#include + + + +int main() { + char arr[] = "Bruh\0\0\0"; + printf("Before memmove: %s\n", &arr[0]); + memmove(arr+3, arr, 4); + printf("After memmove: %s\n", &arr[0]); + return 0; +}