diff --git a/ext/hbsdctl.rb/hbsdctl.c b/ext/hbsdctl.rb/hbsdctl.c index a7e662b..184d151 100644 --- a/ext/hbsdctl.rb/hbsdctl.c +++ b/ext/hbsdctl.rb/hbsdctl.c @@ -31,13 +31,16 @@ feature_set(VALUE self, VALUE path, VALUE state) { int r; char *cpath; + VALUE name; Check_Type(path, T_STRING); Check_Type(state, T_FIXNUM); cpath = RSTRING_PTR(path); + name = rb_funcall(self, rb_intern("name"), 0); + Check_Type(name, T_STRING); r = hbsdcontrol_set_feature_state( cpath, - RSTRING_PTR(rb_funcall(self, rb_intern("name"), 0)), + RSTRING_PTR(name), NUM2INT(state) ); if (r == 0) {