1: /*	@(#)strncat.c	2.1	SCCS id keyword	*/
   2: /*
   3:  * Concatenate s2 on the end of s1.  S1's space must be large enough.
   4:  * At most n characters are moved.
   5:  * Return s1.
   6:  */
   7: 
   8: char *
   9: strncat(s1, s2, n)
  10: register char *s1, *s2;
  11: register n;
  12: {
  13:     register char *os1;
  14: 
  15:     os1 = s1;
  16:     while (*s1++)
  17:         ;
  18:     --s1;
  19:     while (*s1++ = *s2++)
  20:         if (--n < 0) {
  21:             *--s1 = '\0';
  22:             break;
  23:         }
  24:     return(os1);
  25: }
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 596
Valid CSS Valid XHTML 1.0 Strict