Add more const-correct C++ overloads.
libc++ actually provides overloads for all the standard C library stuff,
so we just need to handle the POSIX and GNU extensions, of which there
are just two more: memrchr and strcasestr.
Bug: http://b/22768375
Test: builds
Change-Id: Ie9ed1fbcc794e14a0c9bba13b5307ad677949613
diff --git a/libc/bionic/fortify.cpp b/libc/bionic/fortify.cpp
index cbcc976..4b7b776 100644
--- a/libc/bionic/fortify.cpp
+++ b/libc/bionic/fortify.cpp
@@ -147,7 +147,7 @@
void* __memrchr_chk(const void* s, int c, size_t n, size_t actual_size) {
__check_buffer_access("memrchr", "read from", n, actual_size);
- return memrchr(s, c, n);
+ return memrchr(const_cast<void *>(s), c, n);
}
// memset is performance-critical enough that we have assembler __memset_chk implementations.