From 1e802f6d00ebb12ea639d8a4254efdac57caba2f Mon Sep 17 00:00:00 2001 From: Kosma Moczek Date: Sun, 27 Apr 2014 17:06:10 +0200 Subject: [PATCH] fix minmea_scan("f") when no decimal point is present --- minmea.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/minmea.c b/minmea.c index 4d748a5..e5f1f28 100644 --- a/minmea.c +++ b/minmea.c @@ -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;