mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-30 19:52:13 +01:00
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.
This commit is contained in:
parent
24a994019f
commit
12d0487258
@ -185,7 +185,7 @@ float Stream::parseFloat(char skipChar){
|
|||||||
read(); // consume the character we got with peek
|
read(); // consume the character we got with peek
|
||||||
c = timedPeek();
|
c = timedPeek();
|
||||||
}
|
}
|
||||||
while( (c >= '0' && c <= '9') || c == '.' || c == skipChar );
|
while( (c >= '0' && c <= '9') || c == '.' && !isFraction || c == skipChar );
|
||||||
|
|
||||||
if(isNegative)
|
if(isNegative)
|
||||||
value = -value;
|
value = -value;
|
||||||
|
@ -185,7 +185,7 @@ float Stream::parseFloat(char skipChar){
|
|||||||
read(); // consume the character we got with peek
|
read(); // consume the character we got with peek
|
||||||
c = timedPeek();
|
c = timedPeek();
|
||||||
}
|
}
|
||||||
while( (c >= '0' && c <= '9') || c == '.' || c == skipChar );
|
while( (c >= '0' && c <= '9') || c == '.' && !isFraction || c == skipChar );
|
||||||
|
|
||||||
if(isNegative)
|
if(isNegative)
|
||||||
value = -value;
|
value = -value;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user