Merge pull request #23 from kaspar030/non32bit_compile_fix
use explicit 32bit integer for fractional time calculation
This commit is contained in:
commit
83f7f9b660
4
minmea.c
4
minmea.c
@ -300,8 +300,8 @@ bool minmea_scan(const char *sentence, const char *format, ...)
|
|||||||
|
|
||||||
// Extra: fractional time. Saved as microseconds.
|
// Extra: fractional time. Saved as microseconds.
|
||||||
if (*field++ == '.') {
|
if (*field++ == '.') {
|
||||||
int value = 0;
|
uint32_t value = 0;
|
||||||
int scale = 1000000;
|
uint32_t scale = 1000000LU;
|
||||||
while (isdigit((unsigned char) *field) && scale > 1) {
|
while (isdigit((unsigned char) *field) && scale > 1) {
|
||||||
value = (value * 10) + (*field++ - '0');
|
value = (value * 10) + (*field++ - '0');
|
||||||
scale /= 10;
|
scale /= 10;
|
||||||
|
Loading…
Reference in New Issue
Block a user