summaryrefslogtreecommitdiff
path: root/ext/fiddle/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/fiddle/function.c')
-rw-r--r--ext/fiddle/function.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/fiddle/function.c b/ext/fiddle/function.c
index e0da8b6..50a2d24 100644
--- a/ext/fiddle/function.c
+++ b/ext/fiddle/function.c
@@ -144,9 +144,8 @@ function_call(int argc, VALUE argv[], VALUE self)
cPointer = rb_const_get(mFiddle, rb_intern("Pointer"));
Check_Max_Args("number of arguments", argc);
- if(argc != RARRAY_LENINT(types)) {
- rb_raise(rb_eArgError, "wrong number of arguments (%d for %d)",
- argc, RARRAY_LENINT(types));
+ if (argc != (i = RARRAY_LENINT(types))) {
+ rb_error_arity(argc, i, i);
}
TypedData_Get_Struct(self, ffi_cif, &function_data_type, cif);