From: Pasi Kallinen Date: Wed, 7 Nov 2018 16:39:00 +0000 (+0200) Subject: Prevent out of array index X-Git-Tag: NetHack-3.6.2_Released~170^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6ade9c715ed18a7ca62550f8fdba1a2adccf2ce;p=nethack Prevent out of array index --- diff --git a/src/sp_lev.c b/src/sp_lev.c index 11d692501..488a04d87 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -3912,9 +3912,9 @@ int n; xchar xx = (xchar) x, yy = (xchar) y; while (n > 0) { + --n; if (xs[n] == xx && ys[n] == yy) return TRUE; - --n; } return FALSE; }