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