/***********************************************************************\

    Filename: move.c

\***********************************************************************/

#include "proxlib.h"

/* Copy count bytes from source to dest.  Note that this routine works 
   correctly even when the source and the destination overlap.  */ 

VOID
move(dest, source, count)
register char *dest;
register char *source;
register int count;
{
	if (count <= 0) {
		return;
	}
	if (dest > source) {
		source += count;
		dest += count;
		while (--count >= 0) {
			*--dest = *--source;
		}
	} else {
		while (--count >= 0) {
			*dest++ = *source++;
		}
	}
}
