소스 검색

Improve code_has_value test

Scott Lahteine 10 년 전
부모
커밋
56ff46eb8b
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5
    2
      Marlin/Marlin_main.cpp

+ 5
- 2
Marlin/Marlin_main.cpp 파일 보기

@@ -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…
취소
저장