strcpy.c 558 B

1234567891011121314151617181920212223242526272829303132
  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. libc_hidden_proto(Wstrcpy)
  14. Wchar *Wstrcpy(Wchar * __restrict s1, const Wchar * __restrict s2)
  15. {
  16. register Wchar *s = s1;
  17. #ifdef __BCC__
  18. do {
  19. *s = *s2++;
  20. } while (*s++ != 0);
  21. #else
  22. while ( (*s++ = *s2++) != 0 );
  23. #endif
  24. return s1;
  25. }
  26. libc_hidden_def(Wstrcpy)