|
|
1.1 ! root 1: /* Copyright Bell Telephone Laboratories Whippany, N.J. ! 2: ! 3: * *********************************** ! 4: * *********************************** ! 5: * ****** STRING CONCATINATION ******* ! 6: * *** R. B. Drake WH 8C-005 X4163 *** ! 7: * **** Sun Aug 26 11:42:03 1979 ***** ! 8: * *********************************** ! 9: * *********************************** ! 10: * This routine is similar to the UNIX 'strcat' except that the pointer ! 11: * it returns is to the end of the resultant string instead of the ! 12: * beginning. This is useful when several 'strcat' calls are used in ! 13: * succession to build a string. With the UNIX version the entire string ! 14: * must be scanned from the beginning to find the end. With this one ! 15: * we already have the end after the first call. ! 16: ! 17: */ ! 18: /* "@(#) strcat.c: V 1.1 12/21/80" */ ! 19: ! 20: char *Strcat(s,t) ! 21: char *s,*t; ! 22: { ! 23: register char *s1,*t1; ! 24: s1=s;t1=t; ! 25: while(*s1) s1++; ! 26: while(*t1) ! 27: *s1++= *t1++; ! 28: *s1='\0'; ! 29: return(s1); ! 30: } ! 31: /* add a char to a string and return ptr to end of string */ ! 32: char *carcat(s,t) ! 33: char *s,t; ! 34: { ! 35: char register *s1; ! 36: s1=s; ! 37: while(*s1) s1++; ! 38: *s1++ = t; ! 39: *s1='\0'; ! 40: return(s1); ! 41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.