Skip to content

Commit

Permalink
Fix out-of-bounds error in code
Browse files Browse the repository at this point in the history
  • Loading branch information
marciot committed Mar 31, 2021
1 parent 9299e62 commit d07e958
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ typedef struct {

if (TERN0(HAS_LCD_MENU, user_canceled())) return true;

if (i < (GRID_MAX_POINTS_X)) { // Can't connect to anything farther to the right than GRID_MAX_POINTS_X.
if (i < (GRID_MAX_POINTS_X - 1)) { // Can't connect to anything farther to the right than GRID_MAX_POINTS_X.
// Already a half circle at the edge of the bed.

if (circle_flags.marked(i, j) && circle_flags.marked(i + 1, j)) { // Test whether a leftward line can be done
Expand All @@ -312,7 +312,7 @@ typedef struct {
}
}

if (j < (GRID_MAX_POINTS_Y)) { // Can't connect to anything further back than GRID_MAX_POINTS_Y.
if (j < (GRID_MAX_POINTS_Y - 1)) { // Can't connect to anything further back than GRID_MAX_POINTS_Y.
// Already a half circle at the edge of the bed.

if (circle_flags.marked(i, j) && circle_flags.marked(i, j + 1)) { // Test whether a downward line can be done
Expand Down

0 comments on commit d07e958

Please sign in to comment.