fix minmea_scan("f") when no decimal point is present
This commit is contained in:
parent
334e63d599
commit
1e802f6d00
4
minmea.c
4
minmea.c
@ -166,8 +166,12 @@ bool minmea_scan(const char *sentence, const char *format, ...)
|
|||||||
goto parse_error;
|
goto parse_error;
|
||||||
|
|
||||||
if (value == -1) {
|
if (value == -1) {
|
||||||
|
/* No digits were scanned. */
|
||||||
value = 0;
|
value = 0;
|
||||||
scale = 0;
|
scale = 0;
|
||||||
|
} else if (scale == 0) {
|
||||||
|
/* No decimal point. */
|
||||||
|
scale = 1;
|
||||||
}
|
}
|
||||||
if (sign)
|
if (sign)
|
||||||
value *= sign;
|
value *= sign;
|
||||||
|
Loading…
Reference in New Issue
Block a user