summaryrefslogtreecommitdiff
path: root/libc/string/generic/strcpy.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-12 14:48:10 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-12 14:48:10 +0000
commit9611f84e124405edc8ce1af0b40560c3a7d6ae72 (patch)
tree449871ba49acb16d65de8c3ec5be2ff71692e3d8 /libc/string/generic/strcpy.c
parent6602ba129f062e26a875d8f3b947504500dcc261 (diff)
*: remove vestiges of gcc's "bounded pointers" feature,
it is dead (not supported by gcc) for years. (more of it remains in multiple copies of sigaction.c)
Diffstat (limited to 'libc/string/generic/strcpy.c')
-rw-r--r--libc/string/generic/strcpy.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/libc/string/generic/strcpy.c b/libc/string/generic/strcpy.c
index 99e077139..5f2758153 100644
--- a/libc/string/generic/strcpy.c
+++ b/libc/string/generic/strcpy.c
@@ -24,24 +24,15 @@
/* Experimentally off - libc_hidden_proto(strcpy) */
/* Copy SRC to DEST. */
-char *strcpy (char *dest, const char *src)
+char *strcpy(char *dest, const char *src)
{
- reg_char c;
- char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src);
- const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1;
- size_t n;
-
- do
- {
- c = *s++;
- s[off] = c;
- }
- while (c != '\0');
-
- n = s - src;
- (void) CHECK_BOUNDS_HIGH (src + n);
- (void) CHECK_BOUNDS_HIGH (dest + n);
-
- return dest;
+ char *dst = dest;
+
+ while ((*dst = *src) != '\0') {
+ src++;
+ dst++;
+ }
+
+ return dest;
}
libc_hidden_def(strcpy)