From: robertl Date: Wed, 22 Sep 2004 17:07:17 +0000 (+0000) Subject: Don't output leading zero for lat. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~3907 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=eea4fbf94d78de1ae4b6a6a043c92c9e6feff8d2;p=gpsbabel.git Don't output leading zero for lat. --- diff --git a/gpsbabel/nmea.c b/gpsbabel/nmea.c index f8664afa8..3b0f136ae 100644 --- a/gpsbabel/nmea.c +++ b/gpsbabel/nmea.c @@ -396,7 +396,7 @@ nmea_wayptpr(const waypoint *wpt) lon = degrees2ddmm(wpt->longitude); s = mkshort(mkshort_handle, wpt->shortname); - snprintf(obuf, sizeof(obuf), "GPWPL,%09.3f,%c,%09.3f,%c,%s", + snprintf(obuf, sizeof(obuf), "GPWPL,%08.3f,%c,%09.3f,%c,%s", fabs(lat), lat < 0 ? 'S' : 'N', fabs(lon), lon < 0 ? 'W' : 'E', s @@ -428,7 +428,7 @@ nmea_trackpt_pr(const waypoint *wpt) hms = 0; } - snprintf(obuf, sizeof(obuf), "GPGGA,%06d,%09.3f,%c,%09.3f,%c,04,0,0,%.3f,M,0.0,M,,", + snprintf(obuf, sizeof(obuf), "GPGGA,%06d,%08.3f,%c,%09.3f,%c,04,0,0,%.3f,M,0.0,M,,", hms, fabs(lat), lat < 0 ? 'S' : 'N', fabs(lon), lon < 0 ? 'W' : 'E',