Mercurial > hg > xemacs-beta
comparison src/strcat.c @ 398:74fd4e045ea6 r21-2-29
Import from CVS: tag r21-2-29
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:13:30 +0200 |
parents | 850242ba4a81 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
397:f4aeb21a5bad | 398:74fd4e045ea6 |
---|---|
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++; |