Added test for extra close paren at end of expression

This commit is contained in:
Janet B. Anderson
1993-11-04 15:42:00 +00:00
parent 9f047b0f64
commit e84d8b7167
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -43,6 +43,7 @@
* .12 08-21-92 jba ANSI c changes
* .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
*/
/*
@@ -430,7 +431,8 @@ short *perror;
/* add operators to postfix until matching paren */
while (pstacktop->element[0] != '('){
if (pstacktop == &stack[1]){
if (pstacktop == &stack[1] ||
pstacktop == &stack[0]){
*perror = 6;
return(-1);
}
+3 -1
View File
@@ -43,6 +43,7 @@
* .12 08-21-92 jba ANSI c changes
* .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
*/
/*
@@ -430,7 +431,8 @@ short *perror;
/* add operators to postfix until matching paren */
while (pstacktop->element[0] != '('){
if (pstacktop == &stack[1]){
if (pstacktop == &stack[1] ||
pstacktop == &stack[0]){
*perror = 6;
return(-1);
}