Revision
3725
Author
lsansonetti@apple.com
Date
2010-03-09 18:13:37 -0800 (Tue, 09 Mar 2010)

Log Message

misc bug fix

Modified Paths

Diff

Modified: MacRuby/branches/icu/ext/digest/digest.c (3724 => 3725)


--- MacRuby/branches/icu/ext/digest/digest.c	2010-03-10 01:54:46 UTC (rev 3724)
+++ MacRuby/branches/icu/ext/digest/digest.c	2010-03-10 02:13:37 UTC (rev 3725)
@@ -541,8 +541,9 @@
 
     Data_Get_Struct(self, void, pctx);
 
-    str = rb_str_new(0, algo->digest_len);
-    algo->finish_func(pctx, (unsigned char *)RSTRING_PTR(str));
+    str = rb_bstr_new();
+    rb_bstr_resize(str, algo->digest_len);
+    algo->finish_func(pctx, rb_bstr_bytes(str));
 
     /* avoid potential coredump caused by use of a finished context */
     algo->init_func(pctx);