comparison src/strcat.c @ 442:abe6d1db359e r21-2-36

Import from CVS: tag r21-2-36
author cvs
date Mon, 13 Aug 2007 11:35:02 +0200
parents 3ecd8885ac67
children 2aa9cd456ae7
comparison
equal deleted inserted replaced
441:72a7cfa4a488 442:abe6d1db359e
25 25
26 /* In HPUX 10 the strcat function references memory past the last byte of 26 /* In HPUX 10 the strcat function references memory past the last byte of
27 the string! This will core dump if the memory following the last byte is 27 the string! This will core dump if the memory following the last byte is
28 not mapped. 28 not mapped.
29 29
30 Here is a correct version from glibc 1.09. 30 Here is a correct version from, glibc 1.09.
31 */ 31 */
32 32
33 char *strcat (char *dest, const char *src); 33 char *strcat (char *dest, const char *src);
34 34
35 /* Append SRC on the end of DEST. */ 35 /* Append SRC on the end of DEST. */
36 /* CONST IS LOSING, but const is part of the interface of strcat */
37 char * 36 char *
38 strcat (char *dest, const char *src) 37 strcat (char *dest, const char *src)
39 { 38 {
40 REGISTER char *s1 = dest; 39 REGISTER char *s1 = dest;
41 REGISTER CONST char *s2 = src; 40 REGISTER const char *s2 = src;
42 char c; 41 char c;
43 42
44 /* Find the end of the string. */ 43 /* Find the end of the string. */
45 do 44 do
46 c = *s1++; 45 c = *s1++;