File:  [MW Coherent from dump] / coherent / b / lib / libc / string / memmove.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:35 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * memmove.c
 * ANSI 4.11.2.2.
 * Copy memory.
 * Works correctly between overlapping blocks,
 * provided s1 < s2 assures object *s1 at lower address than *s2.
 * This may not be the case in some machine models (e.g. LARGE i8086).
 */

#include <string.h>

char *memmove(s1, s2, n) char *s1; register char *s2; register size_t n;
{
	register char *cp;

	if (s1 < s2) {
		for (cp = s1; n--; )
			*cp++ = *s2++;
	}
	else if (s1 > s2) {
		s2 += n;
		for (cp = s1 + n; n--; )
			*--cp = *--s2;
	}
	return (s1);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.