Back to index

glibc  2.9
Functions
memccpy.c File Reference
#include <string.h>

Go to the source code of this file.

Functions

void * __memccpy (void *dest, const void *src, int c, n)

Function Documentation

void* __memccpy ( void *  dest,
const void *  src,
int  c,
n   
)

Definition at line 25 of file memccpy.c.

{
  /* Except when N > 65535, this is what a hand-coded version would
     do anyway.  */

  void *found = memchr (src, c, n);

  if (found == NULL)
    {
      (void) memcpy (dest, src, n);
      return NULL;
    }

  (void) memcpy (dest, src, (char *) found + 1 - (char *) src);
  return (PTR) ((char *) dest + ((char *) found + 1 - (char *) src));
}

Here is the call graph for this function: