]> sigrok.org Git - libsigrok.git/commit - src/hardware/brymen-dmm/parser.c
brymen-dmm: improve text to number conversion robustness, signed OL
authorGerhard Sittig <redacted>
Mon, 21 Sep 2020 17:57:32 +0000 (19:57 +0200)
committerGerhard Sittig <redacted>
Mon, 21 Sep 2020 17:57:32 +0000 (19:57 +0200)
commit56213aa0270fc8046dfcc380c137e766be41fd9c
tree7922bd954280e87df2f992a66c4587dc9126874c
parent11addc897a86a039f72cefbebb5058611ad79102
brymen-dmm: improve text to number conversion robustness, signed OL

The BM850(a/s) response packets are a mix of binary and text content.
The text part of it is _not_ a regular ASCIIZ string. Enforce the NUL
termination before running standard C library string routines on it.
Rephrase the conversion routine to become more C idiomatic.

Also check the optional sign for overflow conditions, return either
positive or negative infinity as a result.
src/hardware/brymen-dmm/parser.c