mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 22:08:02 +00:00
Improve code_has_value test
This commit is contained in:
parent
ce142afdda
commit
56ff46eb8b
@ -890,8 +890,11 @@ void get_command() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool code_has_value() {
|
bool code_has_value() {
|
||||||
char c = strchr_pointer[1];
|
int i = 1;
|
||||||
return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.';
|
char c = strchr_pointer[i];
|
||||||
|
if (c == '-' || c == '+') c = strchr_pointer[++i];
|
||||||
|
if (c == '.') c = strchr_pointer[++i];
|
||||||
|
return (c >= '0' && c <= '9');
|
||||||
}
|
}
|
||||||
|
|
||||||
float code_value() {
|
float code_value() {
|
||||||
|
Loading…
Reference in New Issue
Block a user