[Dev-luatex] Argument checking in ltexlib.c

Marcel Fabian Kr├╝ger tex at 2krueger.de
Fri Aug 23 00:43:04 CEST 2019


in tex_setmathparm and tex_getmathparm from ltexlib.c, `i` stores the
index of the math parameter to query or set. Given that `i` is obtained
through luaL_checkoption it should never have a invalid value. The
function still check that `i` is in the valid range using the check 

        if (i<0 && i>=math_param_last) {
            /* invalid spec, just ignore it  */

I think this is a typo because i>=math_param_last (with
math_param_last=114) implies i>0 and therefore this condition can never
be true. Maybe || could be used instead of && or the check could be
removed entirly.


More information about the dev-luatex mailing list