Actually use the lua argc

This commit is contained in:
Pasi Kallinen
2026-01-25 18:38:52 +02:00
parent 92a8d1dab3
commit 2dc95dae42
+11 -4
View File
@@ -956,11 +956,18 @@ staticfn int
l_selection_size_description(lua_State *L) l_selection_size_description(lua_State *L)
{ {
int argc = lua_gettop(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)); if (argc == 1) {
return 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[] = { static const struct luaL_Reg l_selection_methods[] = {