From 7a7ed4819ff26fbd86033e3e363e458e8df6edcc Mon Sep 17 00:00:00 2001 From: Gareth Pulham Date: Tue, 2 Sep 2014 00:23:04 +0100 Subject: [PATCH] More sensible parseFloat handling for '.' --- hardware/arduino/cores/arduino/Stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/arduino/cores/arduino/Stream.cpp b/hardware/arduino/cores/arduino/Stream.cpp index f21a411f83b..170c07b8e37 100644 --- a/hardware/arduino/cores/arduino/Stream.cpp +++ b/hardware/arduino/cores/arduino/Stream.cpp @@ -199,7 +199,7 @@ float Stream::parseFloat(char skipChar){ read(); // consume the character we got with peek c = timedPeek(); } - while( (c >= '0' && c <= '9') || c == '.' || c == skipChar ); + while( (c >= '0' && c <= '9') || (c == '.' && !isFraction) || c == skipChar ); if(isNegative) value = -value;