fix some error cases
[calc.git] / parser.c
index f8a7367a8f5a1812a51257b3551c1e2c7624c4f9..e6fc31eb4cc209c06286245091578033395401d0 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -306,6 +306,10 @@ element_t *parser (char *str, char **next, int prio)
         /* check for closing bracket, closing brace or koma */
 
         if ((*str == ')') || (*str == '}') || (*str == ',')) {
+            if (prio == -9) {
+                delelement (root);
+                return ERROR_OP;
+            }
             if (next != NULL) {
                 *next = str;
             }