summaryrefslogtreecommitdiff
path: root/ext/gdbm/gdbm.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/gdbm/gdbm.c')
-rw-r--r--ext/gdbm/gdbm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/gdbm/gdbm.c b/ext/gdbm/gdbm.c
index d84c7be..fad06fa 100644
--- a/ext/gdbm/gdbm.c
+++ b/ext/gdbm/gdbm.c
@@ -518,7 +518,7 @@ static VALUE
fgdbm_has_key(obj, keystr)
VALUE obj, keystr;
{
- datum key, val;
+ datum key;
struct dbmdata *dbmp;
GDBM_FILE dbm;
@@ -528,8 +528,8 @@ fgdbm_has_key(obj, keystr)
GetDBM(obj, dbmp);
dbm = dbmp->di_dbm;
- val = gdbm_fetch(dbm, key);
- if (val.dptr) return Qtrue;
+ if (gdbm_exists(dbm, key))
+ return Qtrue;
return Qfalse;
}