Skip to content

Commit 403102f

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 518ad9d commit 403102f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hardware/arduino/avr/cores/arduino/Stream.cpp

Lines changed: 1 addition & 1 deletion
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)