aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2016-12-02 16:42:45 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2016-12-02 16:42:45 +0000
commit488f14860469fa61e897db51551c74532d17a883 (patch)
tree8339912c5e604edaa25bdcb9aa5fb35fa1ff6186 /usr.bin
parent0bae80a33650474823958d49abd291de65be2798 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/indent/parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/indent/parse.c b/usr.bin/indent/parse.c
index a77019b847487..f6590fd253c26 100644
--- a/usr.bin/indent/parse.c
+++ b/usr.bin/indent/parse.c
@@ -172,7 +172,7 @@ parse(int tk) /* tk: the code for the construct scanned */
case rbrace: /* scanned a } */
/* stack should have <lbrace> <stmt> or <lbrace> <stmtl> */
- if (ps.p_stack[ps.tos - 1] == lbrace) {
+ if (ps.tos > 0 && ps.p_stack[ps.tos - 1] == lbrace) {
ps.ind_level = ps.i_l_follow = ps.il[--ps.tos];
ps.p_stack[ps.tos] = stmt;
}