From bb83662924f304c44c48d852d6198ec9798b1675 Mon Sep 17 00:00:00 2001 From: girst Date: Mon, 4 Mar 2019 21:31:10 +0100 Subject: [PATCH] freecell: join() to foundation: fix fencepost error --- sol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sol.c b/sol.c index 38833d9..4c976ee 100644 --- a/sol.c +++ b/sol.c @@ -582,7 +582,7 @@ int join(int to) { if (to == FOUNDATION) { int status = ERR; - for (int i = 0; i <= TAB_MAX; i++) + for (int i = 0; i <= TAB_MAX+1; i++) switch ((i?t2f:w2f)(i-1, FOUNDATION, 0)) { case WON: return WON; case OK: status = OK; -- 2.39.3