aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/Stream.cpp
diff options
context:
space:
mode:
authorChris--A <chris@genx.biz>2015-06-19 13:07:35 +1000
committerSandeep Mistry <s.mistry@arduino.cc>2015-11-23 15:46:24 -0500
commit475bcd1d4fe686931a041e479f2870f7d754557c (patch)
tree5f082778b57cabf8e57b9c0be735b15450cac44c /cores/arduino/Stream.cpp
parent29e1dbb8be6beb75604094df5c5e736f7af67f79 (diff)
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.
Diffstat (limited to 'cores/arduino/Stream.cpp')
-rw-r--r--cores/arduino/Stream.cpp2
1 files changed, 1 insertions, 1 deletions
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;