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/?p=wumpus.git;a=commitdiff_plain;h=94476feed2b8652d0b551f6dd6b34d57c6dd886f;hp=baf8efe3006bfad06bfc04b5a83499e42c02bf2a 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;