When the parser found a space, it treated it as an invalid digit
and discarded the whole packet. This behavior was incorrect on
2000 count devices, where the first digit can be sent as a space
rather than a '0'.
Convert spaces to '0' and parse them as usual.
Signed-off-by: Alexandru Gagniuc <redacted>
factor = 1000;
for (i = 0; i < 5; i++) {
digit = buf[4 + i];
+ /* Convert spaces to '0', so that we can parse them. */
+ if (digit == ' ')
+ digit = '0';
if (digit == '.') {
decimal_point = i;
} else if (isdigit(digit)) {