From b2af4fb863f43b67851a1cb59767e57a89c0b0cd Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 13 Feb 2015 17:01:53 -0500 Subject: fix bug in popalarm This never caused a program failure because of the low stress on the event module. --- evnt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/evnt.c b/evnt.c index b8dd4e3..d207832 100644 --- a/evnt.c +++ b/evnt.c @@ -178,6 +178,7 @@ popalarm() i = 1; ah[i] = ah[na--]; while ((j = 2 * i) <= na) { + if (j+1 <= na) if (tgt(ah[j].t, ah[j+1].t)) j++; if (!tgt(ah[i].t, ah[j].t)) -- cgit v1.2.3