From: Eric S. Raymond Date: Sat, 4 Apr 2015 10:37:14 +0000 (-0400) Subject: Fix bug spotted by cppcheck. X-Git-Tag: 1.6~1 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=94476feed2b8652d0b551f6dd6b34d57c6dd886f;p=wumpus.git Fix bug spotted by cppcheck. --- diff --git a/superhack.c b/superhack.c index eacb8eb..f4f616e 100644 --- a/superhack.c +++ b/superhack.c @@ -231,7 +231,7 @@ void throw() } for (k = 0; k < j9; k++) - if (path[k] == path[k - 2]) + if (k >= 2 && path[k] == path[k - 2]) { (void) puts("Pies can't fly that crookedly --- try again."); return;