Mercurial > hg > xemacs-beta
comparison src/strcat.c @ 203:850242ba4a81 r20-3b28
Import from CVS: tag r20-3b28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 10:02:21 +0200 |
parents | ac2d302a0011 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
202:61eefc8fc970 | 203:850242ba4a81 |
---|---|
16 not, write to the Free Software Foundation, Inc., 675 Mass Ave, | 16 not, write to the Free Software Foundation, Inc., 675 Mass Ave, |
17 Cambridge, MA 02139, USA. */ | 17 Cambridge, MA 02139, USA. */ |
18 | 18 |
19 /* Synched up with: Not in FSF. */ | 19 /* Synched up with: Not in FSF. */ |
20 | 20 |
21 # include <config.h> | |
22 # ifndef REGISTER /* Strictly enforced in 20.3 */ | |
23 # define REGISTER | |
24 # endif | |
25 | |
21 /* 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 |
22 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 |
23 not mapped. | 28 not mapped. |
24 | 29 |
25 Here is a correct version from glibc 1.09. | 30 Here is a correct version from glibc 1.09. |
26 */ | 31 */ |
27 | 32 |
28 char *strcat (char *dest, const char *src); | 33 char *strcat (char *dest, const char *src); |
29 | 34 |
30 /* 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 */ | |
31 char * | 37 char * |
32 strcat (char *dest, const char *src) | 38 strcat (char *dest, const char *src) |
33 { | 39 { |
34 register char *s1 = dest; | 40 REGISTER char *s1 = dest; |
35 register const char *s2 = src; | 41 REGISTER CONST char *s2 = src; |
36 char c; | 42 char c; |
37 | 43 |
38 /* Find the end of the string. */ | 44 /* Find the end of the string. */ |
39 do | 45 do |
40 c = *s1++; | 46 c = *s1++; |