From ed23768f774eed04f1a9dd25b6e7fb76a2418dc4 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Fri, 5 Jun 2020 15:39:04 +0200 Subject: typeset: Fix leaving corrupted entries in paramtab --- Src/builtin.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Src') diff --git a/Src/builtin.c b/Src/builtin.c index d5a874a95..770930579 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -2480,12 +2480,16 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func), return NULL; } if (on & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z)) { - if (typeset_setwidth(cname, pm, ops, on, 0)) + if (typeset_setwidth(cname, pm, ops, on, 0)) { + unsetparam_pm(pm, 0, 1); return NULL; + } } if (on & (PM_INTEGER | PM_EFLOAT | PM_FFLOAT)) { - if (typeset_setbase(cname, pm, ops, on, 0)) + if (typeset_setbase(cname, pm, ops, on, 0)) { + unsetparam_pm(pm, 0, 1); return NULL; + } } } else { if (idigit(*pname)) @@ -2503,8 +2507,10 @@ typeset_single(char *cname, char *pname, Param pm, UNUSED(int func), */ struct tieddata *tdp = (struct tieddata *) zalloc(sizeof(struct tieddata)); - if (!tdp) + if (!tdp) { + unsetparam_pm(pm, 0, 1); return NULL; + } tdp->joinchar = joinchar; tdp->arrptr = &altpm->u.arr; -- cgit 1.4.1