From c6ade9c715ed18a7ca62550f8fdba1a2adccf2ce Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 7 Nov 2018 18:39:00 +0200 Subject: [PATCH] Prevent out of array index --- src/sp_lev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }