Skip to content

Commit

Permalink
Merge pull request #1585 from galexander1/strtod_e_fix
Browse files Browse the repository at this point in the history
Fix `code_value` (so `G1X1E2` isn't evaluated as `G1 X100 E2`)
  • Loading branch information
thinkyhead committed Mar 28, 2015
2 parents bc2f249 + 3e8c567 commit b14be72
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,12 @@ void get_command()

float code_value()
{
return (strtod(strchr_pointer + 1, NULL));
float ret;
char *e = strchr(strchr_pointer, 'E');
if (e != NULL) *e = 0;
ret = strtod(strchr_pointer+1, NULL);
if (e != NULL) *e = 'E';
return ret;
}

long code_value_long()
Expand Down

0 comments on commit b14be72

Please sign in to comment.