Browse Source

fix bug where, i.e., "G1X1E1" would be interpretted as "G1 X10 E1",

because strtod() will read the E address value as if it was a base 10
exponent.
Greg Alexander 9 years ago
parent
commit
3e8c5678f5
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      Marlin/Marlin_main.cpp

+ 6
- 1
Marlin/Marlin_main.cpp View File

@@ -909,7 +909,12 @@ void get_command()
909 909
 
910 910
 float code_value()
911 911
 {
912
-  return (strtod(strchr_pointer + 1, NULL));
912
+  float ret;
913
+  char *e = strchr(strchr_pointer, 'E');
914
+  if (e != NULL) *e = 0;
915
+  ret = strtod(strchr_pointer+1, NULL);
916
+  if (e != NULL) *e = 'E';
917
+  return ret;
913 918
 }
914 919
 
915 920
 long code_value_long()

Loading…
Cancel
Save