fix minmea_scan("f") when no decimal point is present

This commit is contained in:
Kosma Moczek 2014-04-27 17:06:10 +02:00
parent 334e63d599
commit 1e802f6d00

View File

@ -166,8 +166,12 @@ bool minmea_scan(const char *sentence, const char *format, ...)
goto parse_error;
if (value == -1) {
/* No digits were scanned. */
value = 0;
scale = 0;
} else if (scale == 0) {
/* No decimal point. */
scale = 1;
}
if (sign)
value *= sign;