summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/lib/memcpy.c
blob: 0c688b5090c35cd4fc27fcc6f38501fabd8cdb50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <sys/types.h>

void* memcpy(void* dst, const void* src, size_t count) {
  register char *d=dst;
  register const char *s=src;
  ++count;	/* this actually produces better code than using count-- */
  while (--count) {
    *d = *s;
    ++d; ++s;
  }
  return dst;
}