strcpy.c 603 B

1234567891011121314151617181920212223242526272829303132333435
  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. #else
  11. # define Wstrcpy strcpy
  12. #endif
  13. Wchar *Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2)
  14. {
  15. register Wchar *s = s1;
  16. #ifdef __BCC__
  17. do {
  18. *s = *s2++;
  19. } while (*s++ != 0);
  20. #else
  21. while ( (*s++ = *s2++) != 0 );
  22. #endif
  23. return s1;
  24. }
  25. #ifdef WANT_WIDE
  26. /* wcscpy does not need libc_hidden_def */
  27. #else
  28. libc_hidden_def(strcpy)
  29. #endif