summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2015-02-13 17:01:53 -0500
committerQuentin Carbonneaux2015-02-13 17:04:27 -0500
commitb2af4fb863f43b67851a1cb59767e57a89c0b0cd (patch)
treec9c7cd37b9a4adfc5175640c4e81499aac22462f
parentecc068b38745dc55ef327fb4a1938297ed0e5f43 (diff)
fix bug in popalarm
This never caused a program failure because of the low stress on the event module.
-rw-r--r--evnt.c1
1 files changed, 1 insertions, 0 deletions
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))