home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / SMALL_C / STRNCAT.C < prev    next >
Text File  |  1987-10-04  |  384b  |  17 lines

  1. /*
  2. ** concatenate n bytes max from t to end of s 
  3. ** s must be large enough
  4. */
  5. strncat(s, t, n) char *s, *t; int n; {
  6.   char *d;
  7.   d = s;
  8.   --s;
  9.   while(*++s) ;
  10.   while(n--) {
  11.     if(*s++ = *t++) continue;
  12.     return(d);
  13.     }
  14.   *s = 0;
  15.   return(d);
  16.   }
  17.