From 61b624d149204c2b1c17a2852d088b2eb2aa010b Mon Sep 17 00:00:00 2001 From: eregon Date: Wed, 1 Aug 2012 13:30:51 +0000 Subject: ext/digest/digest.c (hexencode_str_new): return an ASCII string * test/digest: tests for all kind of digests encodings [ruby-core:46792][Bug #6799] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/digest/digest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/digest/digest.c') diff --git a/ext/digest/digest.c b/ext/digest/digest.c index 4d185a8e5d..c603441409 100644 --- a/ext/digest/digest.c +++ b/ext/digest/digest.c @@ -99,7 +99,7 @@ hexencode_str_new(VALUE str_digest) rb_raise(rb_eRuntimeError, "digest string too long"); } - str = rb_str_new(0, digest_len * 2); + str = rb_usascii_str_new(0, digest_len * 2); for (i = 0, p = RSTRING_PTR(str); i < digest_len; i++) { unsigned char byte = digest[i]; -- cgit v1.2.3