[macruby-changes] [2674] MacRuby/trunk/numeric.c

source_changes at macosforge.org source_changes at macosforge.org
Mon Sep 28 21:31:29 PDT 2009


Revision: 2674
          http://trac.macosforge.org/projects/ruby/changeset/2674
Author:   lsansonetti at apple.com
Date:     2009-09-28 21:31:26 -0700 (Mon, 28 Sep 2009)
Log Message:
-----------
fix last fix

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

Modified: MacRuby/trunk/numeric.c
===================================================================
--- MacRuby/trunk/numeric.c	2009-09-29 04:20:03 UTC (rev 2673)
+++ MacRuby/trunk/numeric.c	2009-09-29 04:31:26 UTC (rev 2674)
@@ -1987,18 +1987,16 @@
 static VALUE
 int_chr(VALUE num, SEL sel, int argc, VALUE *argv)
 {
-    char c[2];
     long i = NUM2LONG(num);
+    char c[2] = {i, '\0'};
     rb_encoding *enc;
     VALUE str;
 
-    c[1] = '\0';
     switch (argc) {
       case 0:
 	if (i < 0 || 0xff < i) {
 	    rb_raise(rb_eRangeError, "%"PRIdVALUE " out of char range", i);
 	}
-	c[0] = i;
 	if (i < 0x80) {
 	    return rb_usascii_str_new(c, 1);
 	}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090928/9b421f22/attachment-0001.html>


More information about the macruby-changes mailing list