From c04dffe04961b6e75d53a0a644d8f9f98e499f20 Mon Sep 17 00:00:00 2001 From: matz Date: Thu, 10 Jun 2004 13:39:52 +0000 Subject: [PATCH] * ext/sdbm/init.c (fsdbm_store): sdbm should use StringValue(). [ruby-talk:103062] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/sdbm/init.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1875b68cba..e49bab5fb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Jun 10 19:19:41 2004 Yukihiro Matsumoto + + * ext/sdbm/init.c (fsdbm_store): sdbm should use StringValue(). + [ruby-talk:103062] + Wed Jun 9 16:09:01 2004 akira yamada * lib/uri/generic.rb (URI::Generic::merge, diff --git a/ext/sdbm/init.c b/ext/sdbm/init.c index 2dfd17196c..0f9ae1dbff 100644 --- a/ext/sdbm/init.c +++ b/ext/sdbm/init.c @@ -475,14 +475,12 @@ fsdbm_store(obj, keystr, valstr) } fdbm_modify(obj); - keystr = rb_obj_as_string(keystr); + StringValue(keystr); key.dptr = RSTRING(keystr)->ptr; key.dsize = RSTRING(keystr)->len; - if (NIL_P(valstr)) return fsdbm_delete(obj, keystr); - - valstr = rb_obj_as_string(valstr); + StringValue(valstr); val.dptr = RSTRING(valstr)->ptr; val.dsize = RSTRING(valstr)->len;