/*
	mem_ccpy

	Copy "n" characters from src to dst areas, or until the character "c"
	has been copied, whichever occurs first.

	Returns the address of the byte following the last one copied,
	or returns NULL if "c" is not encountered.
*/
#include <ncbi.h>
#include <gishlib.h>

Nlm_VoidPtr _cdecl
mem_ccpy(d, s, c, n)
	Nlm_VoidPtr	d, s;
	register int	c;
	register size_t	n;
{
	register CharPtr	src = s, dst = d;

	while (n-- > 0)
		if ((*dst++ = *src++) == c)
			return dst;

	return NULL;
}
