summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-05-16 00:25:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-05-16 00:25:18 +0000
commitfd483664fc48efa80fd14fd705add9bd11f1458a (patch)
tree51b0f27454080680af25950650be7e311c44d477 /string.c
parent83dd92eb207b987ef02246ae2c45d287faedae55 (diff)
downloadruby-fd483664fc48efa80fd14fd705add9bd11f1458a.tar.gz
ruby-fd483664fc48efa80fd14fd705add9bd11f1458a.tar.xz
ruby-fd483664fc48efa80fd14fd705add9bd11f1458a.zip
* re.c (rb_reg_initialize): should not modify untainted objects in
safe levels higher than 3. * re.c (rb_memcmp): type change from char* to const void*. git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/string.c b/string.c
index c428ea7d7..5010274cd 100644
--- a/string.c
+++ b/string.c
@@ -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;