home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 163_02 / strncat.c < prev    next >
Text File  |  1988-01-31  |  384b  |  11 lines

  1. /*
  2. ** append s2 to s1, truncating at n characters if necessary
  3. */
  4. strncat(s1, s2, n) char *s1, *s2; int n; {
  5.   char *strncat;
  6.   strncat = s1;
  7.   while(*s1) s1++;
  8.   while(n--) if(!(*s1++ = *s2++)) break;
  9.   return strncat;
  10.   }
  11.