File: memmove.c

package info (click to toggle)
nmh 1.3-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,056 kB
  • ctags: 4,531
  • sloc: ansic: 50,788; sh: 3,141; makefile: 965; awk: 74
file content (11 lines) | stat: -rw-r--r-- 297 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
/* public domain function from Jan Wolter Unix Incompatibility Notes */
/* http://unixpapa.com/incnote/ */
char *memmove(char *dst, char *src, int n)
{
  if (src > dst)
    for ( ; n > 0; n--)
      *(dst++)= *(src++);
  else
    for (dst+= n-1, src+= n-1; n > 0; n--)
      *(dst--)= *(src--);
}