Fixed SF02/F driver, tested ok

This commit is contained in:
Lorenz Meier 2014-08-31 21:10:04 +02:00
parent a46e1aa60e
commit af3b3680e0
1 changed files with 2 additions and 2 deletions

View File

@ -606,7 +606,7 @@ SF0X::collect()
si_units = strtod(_linebuf, &end);
/* we require at least four characters for a valid number */
if (end > _linebuf + 4) {
if (end > _linebuf + 3) {
valid = true;
} else {
si_units = -1.0f;
@ -615,7 +615,7 @@ SF0X::collect()
}
}
debug("val (float): %8.4f, raw: %s, valid: %s\n", (double)si_units, _linebuf, ((valid) ? "OK" : "NO"));
debug("val (float): %8.4f, raw: %s, valid: %s", (double)si_units, _linebuf, ((valid) ? "OK" : "NO"));
/* done with this chunk, resetting - even if invalid */
_linebuf_index = 0;