Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix invalid indexes in loops.

Signed-off-by: Alexander Danilov <alexander.a.danilov@gmail.com>
  • Loading branch information...
commit d7611f4c39cda373793295504dbcf1cb7cd02b51 1 parent 7ef25c1
@daapp authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 gcode.c
View
4 gcode.c
@@ -347,7 +347,7 @@ uint8_t gc_execute_line(char *line)
// Update axes defined only in block. Offsets current system to defined value. Does not update when
// active coordinate system is selected, but is still active unless G92.1 disables it.
uint8_t i;
- for (i=0; i<=N_AXIS; i++) { // Axes indices are consistent, so loop may be used.
+ for (i=0; i<N_AXIS; i++) { // Axes indices are consistent, so loop may be used.
if (bit_istrue(axis_words,bit(i)) ) {
gc.coord_offset[i] = gc.position[i]-gc.coord_system[i]-target[i];
}
@@ -382,7 +382,7 @@ uint8_t gc_execute_line(char *line)
// absolute mode coordinate offsets or incremental mode offsets.
// NOTE: Tool offsets may be appended to these conversions when/if this feature is added.
uint8_t i;
- for (i=0; i<=N_AXIS; i++) { // Axes indices are consistent, so loop may be used to save flash space.
+ for (i=0; i<N_AXIS; i++) { // Axes indices are consistent, so loop may be used to save flash space.
if ( bit_istrue(axis_words,bit(i)) ) {
if (!absolute_override) { // Do not update target in absolute override mode
if (gc.absolute_mode) {
Please sign in to comment.
Something went wrong with that request. Please try again.