Skip to content

Commit 2af3eda

Browse files
Chris--Asandeepmistry
authored andcommitted
This is a bug fix which prevents parseFloat from proceeding past
multiple decimals '.' in the stream. Only one can be accepted for valid decimal numbers.
1 parent 2709365 commit 2af3eda

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/arduino/Stream.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ float Stream::parseFloat(char skipChar){
185185
read(); // consume the character we got with peek
186186
c = timedPeek();
187187
}
188-
while( (c >= '0' && c <= '9') || c == '.' || c == skipChar );
188+
while( (c >= '0' && c <= '9') || c == '.' && !isFraction || c == skipChar );
189189

190190
if(isNegative)
191191
value = -value;

0 commit comments

Comments
 (0)