Browse Source

Improve code_has_value test

Scott Lahteine 9 years ago
parent
commit
56ff46eb8b
1 changed files with 5 additions and 2 deletions
  1. 5
    2
      Marlin/Marlin_main.cpp

+ 5
- 2
Marlin/Marlin_main.cpp View File

@@ -890,8 +890,11 @@ void get_command() {
890 890
 }
891 891
 
892 892
 bool code_has_value() {
893
-  char c = strchr_pointer[1];
894
-  return (c >= '0' && c <= '9') || c == '-' || c == '+' || c == '.';
893
+  int i = 1;
894
+  char c = strchr_pointer[i];
895
+  if (c == '-' || c == '+') c = strchr_pointer[++i];
896
+  if (c == '.') c = strchr_pointer[++i];
897
+  return (c >= '0' && c <= '9');
895 898
 }
896 899
 
897 900
 float code_value() {

Loading…
Cancel
Save