OSDN Git Service

libc: use __bos instead of __bos0 for strchr.
authorGeorge Burgess IV <gbiv@google.com>
Tue, 4 Apr 2017 01:03:36 +0000 (18:03 -0700)
committerGeorge Burgess IV <gbiv@google.com>
Tue, 4 Apr 2017 18:12:18 +0000 (11:12 -0700)
I dunno why I used __bos0 in the first place; clang's strrchr (and
GCC's strchr+strrchr) both use __bos.

Bug: 34747525
Test: m. Device still boots. cts -m BionicUnitTests shows no new
failures.
Change-Id: Ifec0e05a6a1144fa3e3ac70562af3ec57c09c194

libc/include/string.h

index 26bd93f..0cbd61c 100644 (file)
@@ -358,9 +358,9 @@ size_t strlen(const char* const _Nonnull s __pass_object_size0)
 
 #if  __ANDROID_API__ >= __ANDROID_API_J_MR2__
 __BIONIC_FORTIFY_INLINE
-char* strchr(const char* const _Nonnull s __pass_object_size0, int c)
+char* strchr(const char* const _Nonnull s __pass_object_size, int c)
         __overloadable {
-    size_t bos = __bos0(s);
+    size_t bos = __bos(s);
 
     if (bos == __BIONIC_FORTIFY_UNKNOWN_SIZE) {
         return __builtin_strchr(s, c);