strcpy.c 613 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (C) 2002 Manuel Novoa III
  3. * Copyright (C) 2000-2005 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. #include "_string.h"
  8. #ifdef WANT_WIDE
  9. # define __Wstrcpy __wcscpy
  10. # define Wstrcpy wcscpy
  11. #else
  12. # define __Wstrcpy __strcpy
  13. # define Wstrcpy strcpy
  14. #endif
  15. Wchar attribute_hidden *__Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2)
  16. {
  17. register Wchar *s = s1;
  18. #ifdef __BCC__
  19. do {
  20. *s = *s2++;
  21. } while (*s++ != 0);
  22. #else
  23. while ( (*s++ = *s2++) != 0 );
  24. #endif
  25. return s1;
  26. }
  27. strong_alias(__Wstrcpy,Wstrcpy)