aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index 2fbe36b1b8..ccf4796d3b 100644
--- a/string.c
+++ b/string.c
@@ -5421,7 +5421,7 @@ rb_str_setbyte(VALUE str, VALUE index, VALUE value)
pos += len;
VALUE v = rb_to_int(value);
- VALUE w = rb_int_modulo(v, INT2FIX(256));
+ VALUE w = rb_int_and(v, INT2FIX(0xff));
unsigned char byte = NUM2INT(w) & 0xFF;
if (!str_independent(str))