stpcpy.c 603 B

12345678910111213141516171819202122232425262728293031
  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 __Wstpcpy __wcpcpy
  10. # define Wstpcpy wcpcpy
  11. #else
  12. # define __Wstpcpy __stpcpy
  13. # define Wstpcpy stpcpy
  14. #endif
  15. Wchar attribute_hidden *__Wstpcpy(register Wchar * __restrict s1, const Wchar * __restrict s2)
  16. {
  17. #ifdef __BCC__
  18. do {
  19. *s1 = *s2++;
  20. } while (*s1++ != 0);
  21. #else
  22. while ( (*s1++ = *s2++) != 0 );
  23. #endif
  24. return s1 - 1;
  25. }
  26. strong_alias(__Wstpcpy,Wstpcpy)