From bc43eaaa75335ad127c490aa4a9fe9642798f958 Mon Sep 17 00:00:00 2001 From: cpunch Date: Thu, 11 Feb 2021 00:58:12 -0600 Subject: [PATCH] Minor cbaselib.c cleanup --- src/cbaselib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cbaselib.c b/src/cbaselib.c index 0b6bc01..3c7624a 100644 --- a/src/cbaselib.c +++ b/src/cbaselib.c @@ -93,7 +93,7 @@ int cosmoB_tostring(CState *state, int nargs, CValue *args) { } int cosmoB_loadstring(CState *state, int nargs, CValue *args) { - if (nargs < 1) { + if (nargs != 1) { cosmoV_error(state, "loadstring() expected 1 argument, got %d!", nargs); return 0; } @@ -111,7 +111,7 @@ int cosmoB_loadstring(CState *state, int nargs, CValue *args) { } int cosmoB_error(CState *state, int nargs, CValue *args) { - if (nargs < 1) { + if (nargs != 1) { cosmoV_error(state, "error() expected 1 argument, got %d!", nargs); return 0; } @@ -505,14 +505,14 @@ int cosmoB_sChar(CState *state, int nargs, CValue *args) { return 0; } - // basically, treat the c value on the stack as an """"array"""" with a length of 1 + // basically, treat the character value on the C stack as an """"array"""" with a length of 1 cosmoV_pushLString(state, &c, 1); return 1; } int cosmoB_sLen(CState *state, int nargs, CValue *args) { if (nargs < 1) { - cosmoV_error(state, "string.len() expected 1 argument, got %d", nargs); + cosmoV_error(state, "string.len() expected 1 argument, got %d!", nargs); return 0; }