3 <<strcat>>---concatenate strings
10 char *strcat(char *<[dst]>, const char *<[src]>);
14 char *strcat(<[dst]>, <[src]>)
19 <<strcat>> appends a copy of the string pointed to by <[src]>
20 (including the terminating null character) to the end of the
21 string pointed to by <[dst]>. The initial character of
22 <[src]> overwrites the null character at the end of <[dst]>.
25 This function returns the initial value of <[dst]>
30 <<strcat>> requires no supporting OS subroutines.
39 /* Nonzero if X is aligned on a "long" boundary. */
41 (((long)X & (sizeof (long) - 1)) == 0)
43 #if LONG_MAX == 2147483647L
44 #define DETECTNULL(X) (((X) - 0x01010101) & ~(X) & 0x80808080)
46 #if LONG_MAX == 9223372036854775807L
47 /* Nonzero if X (a long int) contains a NULL byte. */
48 #define DETECTNULL(X) (((X) - 0x0101010101010101) & ~(X) & 0x8080808080808080)
50 #error long int is not a 32bit or 64bit type.
55 #error long int is not a 32bit or 64bit byte
63 _DEFUN (strcat
, (s1
, s2
),
67 #if defined(PREFER_SIZE_OVER_SPEED) || defined(__OPTIMIZE_SIZE__)
80 /* Skip over the data in s1 as quickly as possible. */
83 unsigned long *aligned_s1
= (unsigned long *)s1
;
84 while (!DETECTNULL (*aligned_s1
))
87 s1
= (char *)aligned_s1
;
93 /* s1 now points to the its trailing null character, we can
94 just use strcpy to do the work for us now.
96 ?!? We might want to just include strcpy here.
97 Also, this will cause many more unaligned string copies because
98 s1 is much less likely to be aligned. I don't know if its worth
99 tweaking strcpy to handle this better. */
103 #endif /* not PREFER_SIZE_OVER_SPEED */