strcpy.c 485 B

123456789101112131415161718192021222324252627
  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. while ( (*s++ = *s2++) != 0 );
  17. return s1;
  18. }
  19. #ifndef WANT_WIDE
  20. libc_hidden_def(strcpy)
  21. #endif