diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-19 15:40:52 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-08-19 15:40:52 +0200 |
commit | 6e8867928be69b61d853b58a4d897b2dc313d505 (patch) | |
tree | b338409c1750f842d2162e0ef2b70a950ff33800 | |
parent | cc98c6deff8c9977f3faf403f42b6be46322d359 (diff) | |
parent | 16694051c927b35a853c6ee41a00ad69c81f0bd0 (diff) | |
download | px4-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
-rw-r--r-- | src/drivers/sf0x/sf0x.cpp | 3 |
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; } } |