chiark / gitweb /
Cleanup patch from Ben Hutchings, fixing some odd-looking range
authorSimon Tatham <anakin@pobox.com>
Sat, 20 May 2006 11:54:21 +0000 (11:54 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 20 May 2006 11:54:21 +0000 (11:54 +0000)
checks. He thinks they were harmless (due to being followed by other
range checks in RIGHTOF_DOT and friends) but it clearly can't hurt
to fix them anyway.

[originally from svn r6709]

loopy.c

diff --git a/loopy.c b/loopy.c
index 69ddb56e4190c0a061e729b8dd237208d08ccc12..ce49c7320609a96691e31e0456c51d067e1ed9df 100644 (file)
--- a/loopy.c
+++ b/loopy.c
@@ -1283,7 +1283,7 @@ static int dot_setall_dlines(solver_state *sstate, enum dline dl, int i, int j,
             break;                                                          
         case DLINE_DL:                                                  
         case DLINE_DR:                                                  
-            if (j <= (state)->h && BELOW_DOT(state, i, j) == line_old) {
+            if (j < (state)->h && BELOW_DOT(state, i, j) == line_old) {
                 LV_BELOW_DOT(state, i, j) = line_new;                   
                 retval = TRUE;
             }
@@ -1308,13 +1308,13 @@ static int dot_setall_dlines(solver_state *sstate, enum dline dl, int i, int j,
         case DLINE_UR:                                                  
         case DLINE_DR:                                                  
         case DLINE_HORIZ:                                                  
-            if (i <= (state)->w && RIGHTOF_DOT(state, i, j) == line_old) {
+            if (i < (state)->w && RIGHTOF_DOT(state, i, j) == line_old) {
                 LV_RIGHTOF_DOT(state, i, j) = line_new;                 
                 retval = TRUE;
             }
             break;                                                          
         case DLINE_VERT:                                                  
-            if (j <= (state)->h && BELOW_DOT(state, i, j) == line_old) {
+            if (j < (state)->h && BELOW_DOT(state, i, j) == line_old) {
                 LV_BELOW_DOT(state, i, j) = line_new;                   
                 retval = TRUE;
             }