summaryrefslogtreecommitdiff
path: root/ext/gdbm
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-30 11:06:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-09-30 11:06:05 +0000
commitc0a58759e7596157310371defd28f00ce71db55b (patch)
tree8d5d3b8e3d4bc2333ea64191b205c8e191879c42 /ext/gdbm
parent7f2fd38be6cc4f9289566b5971661a32233377b6 (diff)
gdbm.c: use the default external encoding
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gdbm')
-rw-r--r--ext/gdbm/gdbm.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index cbf96c2..5cd9f14 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -334,7 +334,7 @@ rb_gdbm_fetch2(GDBM_FILE dbm, VALUE keystr)
datum key;
long len;
- StringValue(keystr);
+ ExportStringValue(keystr);
len = RSTRING_LEN(keystr);
if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
@@ -450,7 +450,7 @@ fgdbm_key(VALUE obj, VALUE valstr)
GDBM_FILE dbm;
VALUE keystr, valstr2;
- StringValue(valstr);
+ ExportStringValue(valstr);
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {
@@ -538,7 +538,7 @@ rb_gdbm_delete(VALUE obj, VALUE keystr)
long len;
rb_gdbm_modify(obj);
- StringValue(keystr);
+ ExportStringValue(keystr);
len = RSTRING_LEN(keystr);
if (TOO_LONG(len)) return Qnil;
key.dptr = RSTRING_PTR(keystr);
@@ -725,8 +725,8 @@ fgdbm_store(VALUE obj, VALUE keystr, VALUE valstr)
GDBM_FILE dbm;
rb_gdbm_modify(obj);
- StringValue(keystr);
- StringValue(valstr);
+ ExportStringValue(keystr);
+ ExportStringValue(valstr);
key.dptr = RSTRING_PTR(keystr);
key.dsize = RSTRING_LENINT(keystr);
@@ -991,7 +991,7 @@ fgdbm_has_key(VALUE obj, VALUE keystr)
GDBM_FILE dbm;
long len;
- StringValue(keystr);
+ ExportStringValue(keystr);
len = RSTRING_LENINT(keystr);
if (TOO_LONG(len)) return Qfalse;
key.dptr = RSTRING_PTR(keystr);
@@ -1018,7 +1018,7 @@ fgdbm_has_value(VALUE obj, VALUE valstr)
GDBM_FILE dbm;
VALUE keystr, valstr2;
- StringValue(valstr);
+ ExportStringValue(valstr);
GetDBM2(obj, dbmp, dbm);
for (keystr = rb_gdbm_firstkey(dbm); RTEST(keystr);
keystr = rb_gdbm_nextkey(dbm, keystr)) {