diff --git a/src/runtime.cc b/src/runtime.cc index 1ad5004532..713ddc8d31 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -2446,9 +2446,10 @@ static int SimpleIndexOf(Vector subject, pchar pattern_first_char = pattern[0]; for (int i = idx, n = subject.length() - pattern.length(); i <= n; i++) { if (sizeof(schar) == 1 && sizeof(pchar) == 1) { - schar* pos = reinterpret_cast(memchr(subject.start() + i, - pattern_first_char, - n - i + 1)); + const schar* pos = reinterpret_cast( + memchr(subject.start() + i, + pattern_first_char, + n - i + 1)); if (pos == NULL) return -1; i = pos - subject.start(); } else {