memcpy.c 312 B

12345678910111213141516171819
  1. /*
  2. * Copyright (c) 2013-2019, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <stddef.h>
  7. #include <string.h>
  8. void *memcpy(void *dst, const void *src, size_t len)
  9. {
  10. const char *s = src;
  11. char *d = dst;
  12. while (len--)
  13. *d++ = *s++;
  14. return dst;
  15. }