1
0
mirror of https://github.com/UzixLS/KernelEx.git synced 2025-07-18 23:11:19 +03:00
Files
KernelEx/kexcrt/memswap.c
2018-11-03 16:21:13 +03:00

25 lines
299 B
C
Executable File

/*
* memswap()
*
* Swaps the contents of two nonoverlapping memory areas.
* This really could be done faster...
*/
#include <string.h>
void memswap(void *m1, void *m2, size_t n)
{
char *p = m1;
char *q = m2;
char tmp;
while (n--) {
tmp = *p;
*p = *q;
*q = tmp;
p++;
q++;
}
}