[macruby-changes] [4553] MacRuby/trunk/string.c

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 28 15:32:39 PDT 2010


Revision: 4553
          http://trac.macosforge.org/projects/ruby/changeset/4553
Author:   lsansonetti at apple.com
Date:     2010-09-28 15:32:38 -0700 (Tue, 28 Sep 2010)
Log Message:
-----------
fix a silly bug in String#setbyte

Modified Paths:
--------------
    MacRuby/trunk/string.c

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2010-09-28 22:32:14 UTC (rev 4552)
+++ MacRuby/trunk/string.c	2010-09-28 22:32:38 UTC (rev 4553)
@@ -1760,10 +1760,12 @@
  */
 
 static VALUE
-rstr_setbyte(VALUE self, SEL sel, VALUE index, VALUE value)
+rstr_setbyte(VALUE self, SEL sel, VALUE idx, VALUE value)
 {
     rstr_modify(self);
     str_make_data_binary(RSTR(self));
+
+    long index = NUM2LONG(idx);
     if ((index < -RSTR(self)->length_in_bytes)
 	    || (index >= RSTR(self)->length_in_bytes)) {
 	rb_raise(rb_eIndexError, "index %ld out of string", index);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100928/2618d600/attachment.html>


More information about the macruby-changes mailing list