summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-02-03 12:57:51 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-02-03 12:59:29 +0900
commitffb55e51f11ee87e71a1241c1e0aa59d96dd07bb (patch)
tree5d7e64f1a2bb14a17d76972816c52d9933cb5f2c /src/string.c
parent6d9109bf70e2a86537ac3e1f1ea6053aab96132b (diff)
downloadmruby-ffb55e51f11ee87e71a1241c1e0aa59d96dd07bb.tar.gz
mruby-ffb55e51f11ee87e71a1241c1e0aa59d96dd07bb.zip
Add explicit type cast to return value from `mrmchr`; ref #4940
C++ is stricter in implicit type casting.
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index e6c23618a..9ea19d107 100644
--- a/src/string.c
+++ b/src/string.c
@@ -516,7 +516,7 @@ mrb_memsearch_qs(const unsigned char *xs, mrb_int m, const unsigned char *ys, mr
const unsigned char *ye = ys+n-m+1;
for (;;) {
- y = memchr(y, xs[0], (size_t)(ye-y));
+ y = (const unsigned char*)memchr(y, xs[0], (size_t)(ye-y));
if (y == NULL) return -1;
if (memcmp(xs, y, m) == 0) {
return (mrb_int)(y - ys);