strcat.c 279 B

12345678910111213141516
  1. /* $Id$ */
  2. char *strcat(s1, s2)
  3. register char *s1, *s2;
  4. {
  5. /* Append s2 to the end of s1. */
  6. char *original = s1;
  7. /* Find the end of s1. */
  8. while (*s1++ != 0) ;
  9. s1--;
  10. /* Now copy s2 to the end of s1. */
  11. while (*s1++ = *s2++) /* nothing */ ;
  12. return(original);
  13. }