1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/digest/digest.c (rb_digest_base_s_digest,

rb_digest_base_s_hexdigest): ensure that a string is given.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2001-09-06 05:02:29 +00:00
parent d878585e5f
commit 4c9a9a620a
2 changed files with 17 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Thu Sep 6 13:56:14 2001 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/digest.c (rb_digest_base_s_digest,
rb_digest_base_s_hexdigest): ensure that a string is given.
Thu Sep 6 13:28:51 2001 WATANABE Hirofumi <eban@ruby-lang.org> Thu Sep 6 13:28:51 2001 WATANABE Hirofumi <eban@ruby-lang.org>
* lib/jcode.rb (_regexp_quote): fix quote handling, again. * lib/jcode.rb (_regexp_quote): fix quote handling, again.

View file

@ -96,6 +96,12 @@ rb_digest_base_s_digest(class, str)
if (class == cDigest_Base) if (class == cDigest_Base)
rb_raise(rb_eNotImpError, "Digest::Base is an abstract class"); rb_raise(rb_eNotImpError, "Digest::Base is an abstract class");
#ifdef StringValue
StringValue(str);
#else
Check_Type(str, T_STRING);
#endif
algo = get_digest_base_metadata(class); algo = get_digest_base_metadata(class);
pctx = xmalloc(algo->ctx_size); pctx = xmalloc(algo->ctx_size);
@ -129,6 +135,12 @@ rb_digest_base_s_hexdigest(class, str)
if (class == cDigest_Base) if (class == cDigest_Base)
rb_raise(rb_eNotImpError, "Digest::Base is an abstract class"); rb_raise(rb_eNotImpError, "Digest::Base is an abstract class");
#ifdef StringValue
StringValue(str);
#else
Check_Type(str, T_STRING);
#endif
algo = get_digest_base_metadata(class); algo = get_digest_base_metadata(class);
pctx = xmalloc(algo->ctx_size); pctx = xmalloc(algo->ctx_size);