Procházet zdrojové kódy

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 před 10 roky
rodič
revize
3e8c5678f5
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  1. 6
    1
      Marlin/Marlin_main.cpp

+ 6
- 1
Marlin/Marlin_main.cpp Zobrazit soubor

909
 
909
 
910
 float code_value()
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
 long code_value_long()
920
 long code_value_long()

Loading…
Zrušit
Uložit