1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Ensure we read existing values of the stk table

Obtained from:	NetBSD
This commit is contained in:
Baptiste Daroussin 2015-05-05 09:29:32 +00:00
parent 0a2963a2ac
commit ca887f8d07
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=282464

View File

@ -341,7 +341,8 @@ process(FILE *f)
n = 10 * n + line[i] - '0';
i--;
if (n == 0) {
if (stk[stktop].opno == SZ) {
if (stktop >= 0 &&
stk[stktop].opno == SZ) {
stktop--;
} else {
pe(lineno);
@ -356,7 +357,8 @@ process(FILE *f)
} else if (!fflag && line[i] == 'f') {
n = line[++i];
if (n == 'P') {
if (stk[stktop].opno == FT) {
if (stktop >= 0 &&
stk[stktop].opno == FT) {
stktop--;
} else {
pe(lineno);