From 995dde70c15f638d930c8eb018fd1bee3efd0c3a Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Fri, 12 Jul 2024 04:26:53 -0300 Subject: [PATCH] Replace local var --- lib/bsd/capsicum/ffi.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/bsd/capsicum/ffi.rb b/lib/bsd/capsicum/ffi.rb index 65ab8b0..182e2fc 100644 --- a/lib/bsd/capsicum/ffi.rb +++ b/lib/bsd/capsicum/ffi.rb @@ -54,12 +54,15 @@ module BSD::Capsicum # @return [Fiddle::Pointer] # Returns a pointer to the structure `cap_rights_t` def cap_rights_init(rights, *capabilities) - varargs = capabilities.flat_map { [ULONG_LONG, (Symbol === _1) ? Constants.const_get(_1) : _1] } Fiddle::Function.new( libc["__cap_rights_init"], [INT, VOIDP, VARIADIC], VOIDP - ).call(CAP_RIGHTS_VERSION, rights, *varargs) + ).call( + CAP_RIGHTS_VERSION, rights, + *capabilities.flat_map { + [ULONG_LONG, (Symbol === _1) ? Constants.const_get(_1) : _1] + }) end ##