From f536bf5ced9cea8c9b0b638a4dc4fe6eed098a58 Mon Sep 17 00:00:00 2001 From: Chris--A Date: Fri, 19 Jun 2015 13:07:35 +1000 Subject: [PATCH] =?UTF-8?q?This=20is=20a=20bug=20fix=20which=20prevents=20?= =?UTF-8?q?parseFloat=20from=20proceeding=20past=20multiple=20decimals=20'?= =?UTF-8?q?.'=20in=20the=20stream.=20Only=20one=20can=20be=20accepted=20fo?= =?UTF-8?q?r=20valid=20decimal=20numbers.=EF=BB=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/arduino/Stream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/Stream.cpp b/cores/arduino/Stream.cpp index 1f2f074..f67b431 100644 --- a/cores/arduino/Stream.cpp +++ b/cores/arduino/Stream.cpp @@ -185,7 +185,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;