Minor settings number overflow bug fix.
- The `x` in `$x=val` would overflow when a value larger than 255 was entered and passed to Grbl. This resulted with unintended parameters being set by the overflow value. To fix, simply check for values larger than 255 and error out.
This commit is contained in:
parent
5edf078065
commit
322feba52f
2
system.c
2
system.c
@ -190,7 +190,7 @@ uint8_t system_execute_line(char *line)
|
||||
}
|
||||
} else { // Store global setting.
|
||||
if(!read_float(line, &char_counter, &value)) { return(STATUS_BAD_NUMBER_FORMAT); }
|
||||
if(line[char_counter] != 0) { return(STATUS_INVALID_STATEMENT); }
|
||||
if((line[char_counter] != 0) || (parameter > 255)) { return(STATUS_INVALID_STATEMENT); }
|
||||
return(settings_store_global_setting((uint8_t)parameter, value));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user