From 9d7810d8c509258fe776a2b7f51aee1375d660af Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 29 Jan 2002 19:07:57 +0000 Subject: [PATCH] Update. 2002-01-29 Ben Collins * string/bits/string2.h (__mempcpy): Protect size arg for addition when using __builtin_memcpy. --- ChangeLog | 5 +++++ string/bits/string2.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 83c5ece932..ea804c3ea4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-01-29 Ben Collins + + * string/bits/string2.h (__mempcpy): Protect size arg for + addition when using __builtin_memcpy. + 2002-01-29 Ulrich Drepper * stdlib/Makefile (tests): Add tst-qsort. diff --git a/string/bits/string2.h b/string/bits/string2.h index 6c56c63cc1..da168facc2 100644 --- a/string/bits/string2.h +++ b/string/bits/string2.h @@ -202,7 +202,7 @@ __STRING2_COPY_TYPE (8); # define __mempcpy(dest, src, n) \ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ && __string2_1bptr_p (src) && n <= 8 \ - ? __builtin_memcpy (dest, src, n) + n \ + ? __builtin_memcpy (dest, src, n) + (n) \ : __mempcpy (dest, src, n))) # else # define __mempcpy(dest, src, n) \