summaryrefslogtreecommitdiff
path: root/ext/digest/digest.c
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-01 13:30:51 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-08-01 13:30:51 +0000
commit61b624d149204c2b1c17a2852d088b2eb2aa010b (patch)
tree2751b726a511d78ff7b893c93824f960fbd83a13 /ext/digest/digest.c
parentf52eefece1c24503c607be7b059fe82639f128f7 (diff)
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
Diffstat (limited to 'ext/digest/digest.c')
-rw-r--r--ext/digest/digest.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/digest/digest.c b/ext/digest/digest.c
index 4d185a8..c603441 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];