* bug #23163: various minor fixes for the benefit of older Unixes
[mmh] / sbr / memmove.c
1 /* public domain function from Jan Wolter Unix Incompatibility Notes */
2 /* http://unixpapa.com/incnote/ */
3 char *memmove(char *dst, char *src, int n)
4 {
5   if (src > dst)
6     for ( ; n > 0; n--)
7       *(dst++)= *(src++);
8   else
9     for (dst+= n-1, src+= n-1; n > 0; n--)
10       *(dst--)= *(src--);
11 }