Avoid confusing "read prevented write" log messages.
Moving to a "function: message" style avoids ambiguity.
Change-Id: If9d590e50265c61725d3673bd03796e65edd2d5e
diff --git a/libc/bionic/__strrchr_chk.cpp b/libc/bionic/__strrchr_chk.cpp
index fe56c9a..4037207 100644
--- a/libc/bionic/__strrchr_chk.cpp
+++ b/libc/bionic/__strrchr_chk.cpp
@@ -31,17 +31,17 @@
#include <string.h>
#include "private/libc_logging.h"
-extern "C" char* __strrchr_chk(const char *p, int ch, size_t s_len)
-{
- char *save;
-
- for (save = NULL;; ++p, s_len--) {
- if (s_len == 0)
- __fortify_chk_fail("strrchr prevented read past end of buffer", 0);
- if (*p == (char) ch)
- save = (char *)p;
- if (!*p)
- return(save);
+extern "C" char* __strrchr_chk(const char *p, int ch, size_t s_len) {
+ for (char* save = NULL;; ++p, s_len--) {
+ if (s_len == 0) {
+ __fortify_chk_fail("strrchr: prevented read past end of buffer", 0);
}
- /* NOTREACHED */
+ if (*p == (char) ch) {
+ save = (char *)p;
+ }
+ if (!*p) {
+ return(save);
+ }
+ }
+ /* NOTREACHED */
}