COHERENT manpages

This page displays the COHERENT manpage for memccpy() [Copy a region of memory up to a set character].

List of available manpages
Index


memccpy() -- String Function (libc)

Copy a region of memory up to a set character
#include <string.h>
char *memccpy(dest, src, c, n)
char *dest, *src; unsigned int c, n;

memccpy() copies characters from src to dest, stopping when either it finds
the first occurrence of character c  or it has copied n characters.  Unlike
the routines  strcpy() and  strncpy(), memcpy()  copies from one  region to
another.  Therefore, it will not halt automatically when it encounters NUL.

memccpy()  returns a  pointer to  the first location  after character  c in
dest, or NULL if character c was not found.

See Also

libc,
memcpy(),
strcpy(),
strncpy(),
string.h

Notes

memccpy() is  not part of the  ANSI Standard.  Use of  this library routine
may restrict portability.

If  dest and  src overlap,  the behavior of  memccpy() is  undefined.  dest
should point to enough reserved memory  to hold n bytes of data; otherwise,
data corruption may result.