From 0e92ddea2b6e1e7b887ffeff6d17b5743492e3a2 Mon Sep 17 00:00:00 2001 From: CPunch Date: Thu, 12 Nov 2020 16:27:50 -0600 Subject: [PATCH] fixed invalid objection string --- src/cvm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cvm.c b/src/cvm.c index ac5b3c1..4a267a9 100644 --- a/src/cvm.c +++ b/src/cvm.c @@ -161,7 +161,7 @@ COSMOVMRESULT cosmoV_call(CState *state, int args) { CObjClosure *closure = method->closure; if (args+1 != closure->function->args) { - runtimeError(state, "Expected %d parameters for %s, got %d!", closure->function->args, closure->function->name == NULL ? UNNAMEDCHUNK : closure->function->name->str, args); + runtimeError(state, "Expected %d parameters for %s, got %d!", closure->function->args, closure->function->name == NULL ? UNNAMEDCHUNK : closure->function->name->str, args+1); return COSMOVM_RUNTIME_ERR; } @@ -191,7 +191,7 @@ COSMOVMRESULT cosmoV_call(CState *state, int args) { CObjClosure *closure = cosmoV_readClosure(ret); if (args+1 != closure->function->args) { - runtimeError(state, "Expected %d parameters for %s, got %d!", closure->function->args, closure->function->name == NULL ? UNNAMEDCHUNK : closure->function->name->str, args); + runtimeError(state, "Expected %d parameters for %s, got %d!", closure->function->args, closure->function->name == NULL ? UNNAMEDCHUNK : closure->function->name->str, args+1); return COSMOVM_RUNTIME_ERR; }