From 2dc95dae423420d9973985b21b28b27593de6175 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 25 Jan 2026 18:38:52 +0200 Subject: [PATCH] Actually use the lua argc --- src/nhlsel.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/nhlsel.c b/src/nhlsel.c index 3dad65bfb..79ece1aae 100644 --- a/src/nhlsel.c +++ b/src/nhlsel.c @@ -956,11 +956,18 @@ staticfn int l_selection_size_description(lua_State *L) { int argc = lua_gettop(L); - struct selectionvar *sel = l_selection_check(L, 1); - char buf[BUFSZ]; - lua_pushstring(L, selection_size_description(sel, buf)); - return 1; + if (argc == 1) { + struct selectionvar *sel = l_selection_check(L, 1); + char buf[BUFSZ]; + + lua_pushstring(L, selection_size_description(sel, buf)); + return 1; + } else { + nhl_error(L, "wrong parameters"); + /*NOTREACHED*/ + } + return 0; } static const struct luaL_Reg l_selection_methods[] = {