strncat.c 433 B

12345678910111213141516171819202122232425
  1. /* $Id$ */
  2. /*
  3. * (c) copyright 1987 by the Vrije Universiteit, Amsterdam, The Netherlands.
  4. * See the copyright notice in the ACK home directory, in the file "Copyright".
  5. */
  6. /* append t to s, upto n characters
  7. */
  8. #include "ack_string.h"
  9. char *
  10. strncat(s, t, n)
  11. register char *s;
  12. register _CONST char *t;
  13. register _SIZET n;
  14. {
  15. register char *b = s;
  16. while (*s++)
  17. ;
  18. s--;
  19. while ((n-- > 0) && (*s++ = *t++))
  20. ;
  21. return b;
  22. }