home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
unix
/
unixlib36d
/
src
/
c
/
strcat
< prev
next >
Wrap
Text File
|
1994-03-08
|
841b
|
59 lines
#ifdef __STDC__
static char sccs_id[] = "@(#) strcat.c 1.1 " __DATE__ " HJR";
#else
static char sccs_id[] = "@(#) strcat.c 1.1 26/9/90 HJR";
#endif
/* strcat.c (c) Copyright 1990 H.Rogers */
#ifndef __STDC__
#include "sys/types.h"
#endif
#include <string.h>
#ifdef __STDC__
char *
strcat (char *s, register const char *s2)
#else
char *
strcat (s, s2)
char *s;
register const char *s2;
#endif
{
register char *s1 = s;
while (*s1++);
--s1;
while (*s1++ = *s2++);
return (s);
}
#ifdef __STDC__
char *
strncat (char *s, register const char *s2, register size_t n)
#else
char *
strncat (s, s2, n)
char *s;
register const char *s2;
register size_t n;
#endif
{
register char *s1 = s;
while (*s1++);
--s1;
while (*s1++ = *s2++)
if (!(n--))
{
*--s1 = 0;
break;
}
return (s);
}