From 94476feed2b8652d0b551f6dd6b34d57c6dd886f Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 4 Apr 2015 06:37:14 -0400 Subject: [PATCH] Fix bug spotted by cppcheck. --- superhack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.31.1