diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1130,7 +1130,7 @@ rb_str_index_m(argc, argv, str) { int c = FIX2INT(sub); long len = RSTRING(str)->len; - unsigned char *p = RSTRING(str)->ptr; + unsigned char *p = (unsigned char*)RSTRING(str)->ptr; for (;pos<len;pos++) { if (p[pos] == c) return LONG2NUM(pos); @@ -1252,8 +1252,8 @@ rb_str_rindex_m(argc, argv, str) case T_FIXNUM: { int c = FIX2INT(sub); - unsigned char *p = RSTRING(str)->ptr + pos; - unsigned char *pbeg = RSTRING(str)->ptr; + unsigned char *p = (unsigned char*)RSTRING(str)->ptr + pos; + unsigned char *pbeg = (unsigned char*)RSTRING(str)->ptr; if (pos == RSTRING(str)->len) { if (pos == 0) return Qnil; |