aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2014-08-19 15:40:52 +0200
committerLorenz Meier <lm@inf.ethz.ch>2014-08-19 15:40:52 +0200
commit6e8867928be69b61d853b58a4d897b2dc313d505 (patch)
treeb338409c1750f842d2162e0ef2b70a950ff33800 /src
parentcc98c6deff8c9977f3faf403f42b6be46322d359 (diff)
parent16694051c927b35a853c6ee41a00ad69c81f0bd0 (diff)
downloadpx4-firmware-6e8867928be69b61d853b58a4d897b2dc313d505.tar.gz
px4-firmware-6e8867928be69b61d853b58a4d897b2dc313d505.tar.bz2
px4-firmware-6e8867928be69b61d853b58a4d897b2dc313d505.zip
Merge pull request #1290 from PX4/sf_fix
Require a digit ahead of the dot for a valid number for the SF0x output
Diffstat (limited to 'src')
-rw-r--r--src/drivers/sf0x/sf0x.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/sf0x/sf0x.cpp b/src/drivers/sf0x/sf0x.cpp
index bca1715fa..80ecab2ee 100644
--- a/src/drivers/sf0x/sf0x.cpp
+++ b/src/drivers/sf0x/sf0x.cpp
@@ -598,7 +598,8 @@ SF0X::collect()
memcpy(_linebuf, buf, (lend + 1) - (i + 1));
}
- if (_linebuf[i] == '.') {
+ /* we need a digit before the dot and a dot for a valid number */
+ if (i > 0 && _linebuf[i] == '.') {
valid = true;
}
}