From: John Crispin Date: Tue, 11 Aug 2015 14:53:34 +0000 (+0200) Subject: lat/lng format when printing is incorrect X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fugps.git;a=commitdiff_plain;h=971e6703eb9bed936cc62cd335105bd2acca14ef lat/lng format when printing is incorrect Signed-off-by: Maurice-Jörg Nießen --- diff --git a/nmea.c b/nmea.c index ec0a350..438de9d 100644 --- a/nmea.c +++ b/nmea.c @@ -144,8 +144,8 @@ nmea_rmc_cb(void) LOG("position: %d°%d'%.1f\" %d°%d'%.1f\"\n", latd, latm, flats, lngd, lngm, flngs); - snprintf(latitude, sizeof(latitude), "%d.%d", latd, ms_to_deg(latm, lats)); - snprintf(longitude, sizeof(longitude), "%d.%d", lngd, ms_to_deg(lngm, lngs)); + snprintf(latitude, sizeof(latitude), "%d.%04d", latd, ms_to_deg(latm, lats)); + snprintf(longitude, sizeof(longitude), "%d.%04d", lngd, ms_to_deg(lngm, lngs)); LOG("position: %s %s\n", latitude, longitude); gps_timestamp(); }