diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-06-18 10:55:45 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-06-18 10:55:45 +0000 |
commit | a2159285e80508bb682d90a71270fbddada8bd05 (patch) | |
tree | c491bf7a28d7f8fac7ab05cc860c01dea95c19b1 /Src/math.c | |
parent | 805381040dd69dd02b78423d2d71913b33f3cc33 (diff) | |
download | zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.gz zsh-a2159285e80508bb682d90a71270fbddada8bd05.tar.xz zsh-a2159285e80508bb682d90a71270fbddada8bd05.zip |
zsh-3.1.5-pws-22 zsh-3.1.5-pws-22
Diffstat (limited to 'Src/math.c')
-rw-r--r-- | Src/math.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Src/math.c b/Src/math.c index efbf22e44..7e7e557ed 100644 --- a/Src/math.c +++ b/Src/math.c @@ -733,9 +733,9 @@ mathevall(char *s, int prek, char **ep) char *xptr; zlong xyyval; LV xyylval; - char **xlvals = 0; + char **xlvals = 0, *nlvals[LVCOUNT]; int xsp; - struct mathvalue *xstack = 0; + struct mathvalue *xstack = 0, nstack[STACKSZ]; zlong ret; xlastbase = xnoeval = xunary = xlvc = xyyval = xyylval = xsp = 0; @@ -753,9 +753,10 @@ mathevall(char *s, int prek, char **ep) xsp = sp; xstack = stack; } - stack = (struct mathvalue *)zalloc(STACKSZ*sizeof(struct mathvalue)); + stack = nstack; lastbase = -1; - lvals = (char **)zcalloc(LVCOUNT*sizeof(char *)); + memset(nlvals, 0, LVCOUNT*sizeof(char *)); + lvals = nlvals; lvc = 0; ptr = s; sp = -1; @@ -769,8 +770,6 @@ mathevall(char *s, int prek, char **ep) ret = stack[0].val; - zfree(lvals, LVCOUNT*sizeof(char *)); - zfree(stack, STACKSZ*sizeof(struct mathvalue)); if (--mlevel) { lastbase = xlastbase; noeval = xnoeval; @@ -827,7 +826,8 @@ mathevalarg(char *s, char **ss) static void mathparse(int pc) { - int q, otok, onoeval; + zlong q; + int otok, onoeval; if (errflag) return; |