Mercurial > hg > xemacs-beta
comparison src/strcat.c @ 412:697ef44129c6 r21-2-14
Import from CVS: tag r21-2-14
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:20:41 +0200 |
parents | 74fd4e045ea6 |
children |
comparison
equal
deleted
inserted
replaced
411:12e008d41344 | 412:697ef44129c6 |
---|---|
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 */ | |
36 char * | 37 char * |
37 strcat (char *dest, const char *src) | 38 strcat (char *dest, const char *src) |
38 { | 39 { |
39 REGISTER char *s1 = dest; | 40 REGISTER char *s1 = dest; |
40 REGISTER const char *s2 = src; | 41 REGISTER CONST char *s2 = src; |
41 char c; | 42 char c; |
42 | 43 |
43 /* Find the end of the string. */ | 44 /* Find the end of the string. */ |
44 do | 45 do |
45 c = *s1++; | 46 c = *s1++; |