From 9f263d79f23495e8597da6392795c2111983283b Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Thu, 29 Feb 2024 23:10:28 -0300 Subject: [PATCH] Feature#name could be anything --- ext/hbsdctl.rb/hbsdctl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) {