strcat.c 488 B

1234567891011121314151617181920212223242526
  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 Wstrcat wcscat
  10. #else
  11. # define Wstrcat strcat
  12. #endif
  13. Wchar *Wstrcat(Wchar * __restrict s1, register const Wchar * __restrict s2)
  14. {
  15. register Wchar *s = s1;
  16. while (*s++);
  17. --s;
  18. while ((*s++ = *s2++) != 0);
  19. return s1;
  20. }
  21. libc_hidden_def(Wstrcat)