From 9e64980b6cdf319ffae0a257f72b867f087b185d Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Thu, 3 Feb 1994 09:19:23 +0000 Subject: [PATCH] Changed seperator test to catch invalid commas --- src/libCom/calc/postfix.c | 4 +++- src/libCom/postfix.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libCom/calc/postfix.c b/src/libCom/calc/postfix.c index e2e237cc8..0c0f888da 100644 --- a/src/libCom/calc/postfix.c +++ b/src/libCom/calc/postfix.c @@ -44,6 +44,7 @@ * .13 08-21-92 jba initialized *ppostfix: needed when calc expr not defined * .14 12-11-92 mrk Removed include for stdioLib.h * .15 11-03-93 jba Added test for extra close paren at end of expression + * .16 01-24-94 jba Changed seperator test to catch invalid commas */ /* @@ -413,7 +414,8 @@ short *perror; /* add operators to postfix until open paren */ while (pstacktop->element[0] != '('){ - if (pstacktop == &stack[1]){ + if (pstacktop == &stack[1] || + pstacktop == &stack[0]){ *perror = 6; return(-1); } diff --git a/src/libCom/postfix.c b/src/libCom/postfix.c index e2e237cc8..0c0f888da 100644 --- a/src/libCom/postfix.c +++ b/src/libCom/postfix.c @@ -44,6 +44,7 @@ * .13 08-21-92 jba initialized *ppostfix: needed when calc expr not defined * .14 12-11-92 mrk Removed include for stdioLib.h * .15 11-03-93 jba Added test for extra close paren at end of expression + * .16 01-24-94 jba Changed seperator test to catch invalid commas */ /* @@ -413,7 +414,8 @@ short *perror; /* add operators to postfix until open paren */ while (pstacktop->element[0] != '('){ - if (pstacktop == &stack[1]){ + if (pstacktop == &stack[1] || + pstacktop == &stack[0]){ *perror = 6; return(-1); }