Back to index

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

Go to the source code of this file.


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

Function Documentation

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

Definition at line 28 of file memccpy.c.

  register const char *s = src;
  register char *d = dest;
  register const char x = c;
  register size_t i = n;

  while (i-- > 0)
    if ((*d++ = *s++) == x)
      return d;

  return NULL;