home *** CD-ROM | disk | FTP | other *** search
-
- /*
- * STRNCAT.C
- *
- * (c)Copyright 1990, Matthew Dillon, All Rights Reserved
- */
-
- #include <string.h>
-
- typedef unsigned char ubyte;
-
- char *
- strncat(d, s, n)
- char *d;
- const char *s;
- int n;
- {
- char c;
- char *base= d;
-
- s;
- n;
-
- if (n) {
- d += strlen(d);
- while (c = *s) {
- *d = c;
- ++s;
- ++d;
- if (--n == 0)
- return(base);
- }
- *d = 0;
- }
- return(base);
- }
-
-