diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-08-21 17:12:43 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-08-21 17:12:43 +0000 |
commit | 6c6bb0558c6adebd450cc7037305f89e746597b5 (patch) | |
tree | 062811cf59fbbb94bab8d7cc02894772cbe2d412 /sysdeps/i386/i486/bits/string.h | |
parent | 425966d0707380015fcbcbc9b206500761ab8505 (diff) | |
download | glibc-6c6bb0558c6adebd450cc7037305f89e746597b5.tar.gz glibc-6c6bb0558c6adebd450cc7037305f89e746597b5.tar.xz glibc-6c6bb0558c6adebd450cc7037305f89e746597b5.zip |
Update.
* string/bits/string2.h: Remove strnlen optimization here. * sysdeps/i386/i486/bits/string.h: Add it here. 2001-08-21 Wolfram Gloger <wg@malloc.de> * malloc/malloc.c: Make access to ..._hook pointers thread-safe. 2001-08-21 Ulrich Drepper <drepper@redhat.com>
Diffstat (limited to 'sysdeps/i386/i486/bits/string.h')
-rw-r--r-- | sysdeps/i386/i486/bits/string.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h index a21fc8b830..bbe39adab7 100644 --- a/sysdeps/i386/i486/bits/string.h +++ b/sysdeps/i386/i486/bits/string.h @@ -1,5 +1,5 @@ /* Optimized, inlined string functions. i486 version. - Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -540,6 +540,18 @@ __strlen_g (__const char *__str) } + +#if defined __USE_GNU +#define _HAVE_STRING_ARCH_strnlen 1 +__STRING_INLINE size_t +strnlen (__const char *__string, size_t __maxlen) +{ + __const char *__end = (__const char *) memchr (__string, '\0', __maxlen); + return __end ? (size_t) (__end - __string) : __maxlen; +} +#endif + + /* Copy SRC to DEST. */ #define _HAVE_STRING_ARCH_strcpy 1 #define strcpy(dest, src) \ |