Allow bigger lat/lng numbers in RMC message
authorPetr Štetiar <ynezz@true.cz>
Wed, 27 Jul 2016 12:45:54 +0000 (14:45 +0200)
committerJohn Crispin <john@phrozen.org>
Sun, 24 Jul 2016 04:13:10 +0000 (06:13 +0200)
It works now with following message:

  $GPRMC,122536.0,A,4350.237769,N,01826.423315

Signed-off-by: Petr Štetiar <ynezz@true.cz>
nmea.c

diff --git a/nmea.c b/nmea.c
index 4d9cb902eae294db159cadba59bb26d67be2f8b7..fecdef8d55185c5f3791d6fb9012db14e15ac25b 100644 (file)
--- a/nmea.c
+++ b/nmea.c
@@ -108,8 +108,9 @@ nmea_rmc_cb(void)
                }
        }
 
-       if (strlen(nmea_params[3].str) != 9 || strlen(nmea_params[5].str) != 10) {
-               ERROR("lat/lng have invalid string length\n");
+       if (strlen(nmea_params[3].str) < 9 || strlen(nmea_params[5].str) < 10) {
+               ERROR("lat/lng have invalid string length %d<9, %d<10\n",
+                      strlen(nmea_params[3].str), strlen(nmea_params[5].str));
        } else {
                int latd, latm, lats;
                int lngd, lngm, lngs;