MEMCCPY(3)

NAME
memccpy - copy memory regions with end-token check

SYNOPSIS

#include <string.h>

void* memccpy(void *restrict out, const void *restrict in, int endchar, size_t n);

DESCRIPTION

This function copies up to n bytes from the memory region pointed to by in to the memory region pointed to by out. If a byte matching the endchar is encountered, the byte is copied and copying stops.

If the regions overlap, the behavior is undefined.

RETURNS

memccpy returns a pointer to the first byte following the endchar in the out region. If no byte matching endchar was copied, then NULL is returned.

PORTABILITY

memccpy is a GNU extension.

memccpy requires no supporting OS subroutines.