home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 109.lha / PD_C / lib / strncat.c < prev    next >
C/C++ Source or Header  |  1986-11-20  |  539b  |  23 lines

  1. /*
  2.  * strncat - append at most n characters of string src to dst
  3.  */
  4. char *                                 /* dst */
  5. strncat(dst, src, n)
  6. char *dst;
  7. CONST char *src;
  8. SIZET n;
  9. {
  10.          register char *dscan;
  11.          register CONST char *sscan;
  12.          register SIZET count;
  13.  
  14.          for (dscan = dst; *dscan != '\0'; dscan++)
  15.                    continue;
  16.          sscan = src;
  17.          count = n;
  18.          while (*sscan != '\0' && --count >= 0)
  19.                    *dscan++ = *sscan++;
  20.          *dscan++ = '\0';
  21.          return(dst);
  22. }
  23.