This file looks large and may slow your browser down if we attempt
to syntax highlight it, so we are showing it without any
pretty colors.
Highlight
it anyway.
| 1 |
/* |
| 2 |
* Scratch implementation of memmove() in case your C library lacks one. |
| 3 |
* |
| 4 |
* For license terms, see the file COPYING in this directory. |
| 5 |
*/ |
| 6 |
char *memmove(char *dst, register char *src, register int n) |
| 7 |
{ |
| 8 |
register char *svdst; |
| 9 |
|
| 10 |
if ((dst > src) && (dst < src + n)) |
| 11 |
{ |
| 12 |
src += n; |
| 13 |
for (svdst = dst + n; n-- > 0; ) |
| 14 |
*--svdst = *--src; |
| 15 |
} |
| 16 |
else |
| 17 |
{ |
| 18 |
for (svdst = dst; n-- > 0; ) |
| 19 |
*svdst++ = *src++; |
| 20 |
} |
| 21 |
return dst; |
| 22 |
} |