]> git.itanic.dy.fi Git - rrdd/commit
onewire_parser: Fix "85" degree handling case
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 20 Aug 2019 18:38:02 +0000 (21:38 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Tue, 20 Aug 2019 18:38:02 +0000 (21:38 +0300)
commitb8fa58abf012c00d1a0a51799ac77333c715527d
treef864155eb4280e6a1f6acff8eadbd293623a11bf
parentd87036c4de7e54852163f8c19aa0061b4c6e2e6b
onewire_parser: Fix "85" degree handling case

The current method of comparing the beginning of the raw string to
"85" will discard all measurements, even valid ones that are different
than strictly "85". This includes values such as 85.5, which can be
100% correct.

This also fixes a small memory leak that took place when we actually
got "85" from the sensor. If that happens, it is a failure, but the
*_read() function still had allocated the string for us. So it must be
freed.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
onewire_parser.c