summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_libc.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-09-03 13:09:28 +0000
committerAlexey Samsonov <samsonov@google.com>2013-09-03 13:09:28 +0000
commit72870db5f2e0e83b2e925eef594dacfae275a8de (patch)
treee3e08177c9096693492a5187af16abe172a07c96 /lib/sanitizer_common/sanitizer_libc.cc
parentda506a9ae831f275267ddc9ee74e5474246369b1 (diff)
downloadcompiler-rt-72870db5f2e0e83b2e925eef594dacfae275a8de.tar.gz
Add internal_strchrnul function
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189797 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_libc.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_libc.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_libc.cc b/lib/sanitizer_common/sanitizer_libc.cc
index a3fb50c68..72ddf0fd3 100644
--- a/lib/sanitizer_common/sanitizer_libc.cc
+++ b/lib/sanitizer_common/sanitizer_libc.cc
@@ -125,6 +125,13 @@ char* internal_strchr(const char *s, int c) {
}
}
+char *internal_strchrnul(const char *s, int c) {
+ char *res = internal_strchr(s, c);
+ if (!res)
+ res = (char*)s + internal_strlen(s);
+ return res;
+}
+
char *internal_strrchr(const char *s, int c) {
const char *res = 0;
for (uptr i = 0; s[i]; i++) {