From f3253039a32af98924b0606316a83c8129dff4d4 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Sat, 20 May 2017 15:08:16 +0200 Subject: [PATCH] use explicit 32bit integer for fractional time calculation --- minmea.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/minmea.c b/minmea.c index e5633c6..e409391 100644 --- a/minmea.c +++ b/minmea.c @@ -300,8 +300,8 @@ bool minmea_scan(const char *sentence, const char *format, ...) // Extra: fractional time. Saved as microseconds. if (*field++ == '.') { - int value = 0; - int scale = 1000000; + uint32_t value = 0; + uint32_t scale = 1000000LU; while (isdigit((unsigned char) *field) && scale > 1) { value = (value * 10) + (*field++ - '0'); scale /= 10;