From 9611f84e124405edc8ce1af0b40560c3a7d6ae72 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Fri, 12 Dec 2008 14:48:10 +0000 Subject: *: 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) --- libc/string/generic/strcpy.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'libc/string') 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) -- cgit v1.2.3