source: trunk/sys/dietlibc/memccpy.c @ 127

Last change on this file since 127 was 1, checked in by alain, 8 years ago

First import

File size: 308 bytes
RevLine 
[1]1#define _POSIX_SOURCE
2#define _XOPEN_SOURCE
3#include <sys/types.h>
4#include <string.h>
5
6void *memccpy(void *dst, const void *src, int c, size_t count)
7{
8  char *a = dst;
9  const char *b = src;
10  while (count--)
11  {
12    *a++ = *b;
13    if (*b==c)
14    {
15      return (void *)a;
16    }
17    b++;
18  }
19  return 0;
20}
Note: See TracBrowser for help on using the repository browser.