aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/i386/i486/bits/string.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-30 04:08:58 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-30 04:08:58 +0000
commit9c3b1ceba810a51cb0069644e1bc72cb9a1cbc8c (patch)
tree44df27f8867ae748b1923888bdd9bde08c65034e /sysdeps/i386/i486/bits/string.h
parentf58580396d75a6d7429a909444ad8b70dd7dfff8 (diff)
downloadglibc-9c3b1ceba810a51cb0069644e1bc72cb9a1cbc8c.tar
glibc-9c3b1ceba810a51cb0069644e1bc72cb9a1cbc8c.tar.gz
glibc-9c3b1ceba810a51cb0069644e1bc72cb9a1cbc8c.tar.bz2
glibc-9c3b1ceba810a51cb0069644e1bc72cb9a1cbc8c.zip
Update.
* string/bits/string2.h (strspn): Evaluate first argument if second is "". (strpbrk): Likewise. * sysdeps/i386/i486/bits/string.h: Likewise. * string/Makefile (tests): Add bug-strspn1 and bug-strpbrk1. * string/bug-strspn1.c: New file. * string/bug-strpbrk1.c: New file. Test cases by Joseph S. Myers <jsm28@cam.ac.uk>. * string/bits/string2.h (strncat): Terminate string correctly. * sysdeps/i386/i486/bits/string.h (strncat): Likewise. * string/Makefile (tests): Add bug-strncat1. * string/bug-strncat1.c: New file. Test case by Joseph S. Myers <jsm28@cam.ac.uk>. 2000-10-27 Ben Collins <bcollins@debian.org> * sysdeps/generic/lockf.c (lockf): Set l_type to F_RDLCK before calling for F_GETLK. 2000-10-29 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'sysdeps/i386/i486/bits/string.h')
-rw-r--r--sysdeps/i386/i486/bits/string.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 9d88ee3149..c880f94eed 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -987,8 +987,9 @@ __strcat_g (char *__dest, __const char *__src)
__builtin_constant_p (src) && __builtin_constant_p (n) \
? (strlen (src) < ((size_t) (n)) \
? strcat (__dest, src) \
- : (memcpy (strchr (__dest, '\0'), \
- (__const char *) src, n), __dest)) \
+ : (*((char *)__mempcpy (strchr (__dest, '\0'), \
+ (__const char *) src, n)) = 0, \
+ __dest)) \
: __strncat_g (__dest, src, n); }))
__STRING_INLINE char *__strncat_g (char *__dest, __const char __src[],
@@ -1543,7 +1544,7 @@ __strcspn_g (__const char *__s, __const char *__reject)
#define strspn(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
- ? 0 \
+ ? ((void) (s), 0) \
: ((accept)[1] == '\0' \
? __strspn_c1 (s, (((accept)[0] << 8 ) & 0xff00)) \
: __strspn_cg (s, accept, strlen (accept)))) \
@@ -1656,7 +1657,7 @@ __strspn_g (__const char *__s, __const char *__accept)
#define strpbrk(s, accept) \
(__extension__ (__builtin_constant_p (accept) && sizeof ((accept)[0]) == 1 \
? ((accept)[0] == '\0' \
- ? NULL \
+ ? ((void) (s), NULL) \
: ((accept)[1] == '\0' \
? strchr (s, (accept)[0]) \
: __strpbrk_cg (s, accept, strlen (accept)))) \