diff --git a/a1/program.c b/a1/program.c index c8bb8ea..3f29499 100644 --- a/a1/program.c +++ b/a1/program.c @@ -35,9 +35,9 @@ int main() } else if (ch == ')' || ch == '}' || ch == ']' || ch == '>') { - if (top == 0) + if (top == -1) { - printf("Crossed bracket %c in %d, expected opening bracket\n", ch, i); + printf("Unexpected closing bracket %c in %d\n", ch, i); return 0; } else if (!isMatchingPair(stack[top], ch))