aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2019-08-17 17:36:51 +0100
committerSimon Tatham <anakin@pobox.com>2022-07-31 08:53:08 +0100
commit4c1e47b272274972556d7790384998e593d0ae57 (patch)
treeb13781c46e94ce5900fb2100804d52cad2d870ab
parentcd338a1a35394a7abfd517569e908b54bf657aaa (diff)
downloadpuzzles-4c1e47b272274972556d7790384998e593d0ae57.zip
puzzles-4c1e47b272274972556d7790384998e593d0ae57.tar.gz
puzzles-4c1e47b272274972556d7790384998e593d0ae57.tar.bz2
puzzles-4c1e47b272274972556d7790384998e593d0ae57.tar.xz
Bridges: Fix off-by-one in WITHIN()
WITHIN() used to treat the min and max as inclusive bounds but was changed to treat the max as exclusive, apparently accidentally. Fixed: 5f5b284c0bdd ("Use C99 bool within source modules.")
-rw-r--r--bridges.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/bridges.c b/bridges.c
index 03b0623..074940c 100644
--- a/bridges.c
+++ b/bridges.c
@@ -183,7 +183,7 @@ struct game_state {
#define GRIDCOUNT(s,x,y,f) ((GRID(s,x,y) & (f)) ? (INDEX(s,lines,x,y)) : 0)
-#define WITHIN2(x,min,max) ((x) >= (min) && (x) < (max))
+#define WITHIN2(x,min,max) ((x) >= (min) && (x) <= (max))
#define WITHIN(x,min,max) ((min) > (max) ? \
WITHIN2(x,max,min) : WITHIN2(x,min,max))