strncat.c 386 B

123456789101112131415161718192021
  1. /* $Header$ */
  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. char *
  9. strncat(s, t, n)
  10. register char *s, *t;
  11. register int n;
  12. {
  13. register char *b = s;
  14. while (*s++)
  15. ;
  16. s--;
  17. while ((n-- > 0) && (*s++ = *t++))
  18. ;
  19. return b;
  20. }