]> git.street.me.uk Git - andy/viking.git/commitdiff
Second fix to e778b260c460c218a8efa27c178219cccf731452 to correct elevation output...
authorRob Norris <rw_norris@hotmail.com>
Mon, 2 May 2016 11:21:09 +0000 (12:21 +0100)
committerRob Norris <rw_norris@hotmail.com>
Mon, 2 May 2016 12:44:13 +0000 (13:44 +0100)
src/gpx.c

index 6ee2ffde038e440ad0db95b96051f7cc4571bc21..f11d781397256151aad6522c393ec55e7cfc8e1d 100644 (file)
--- a/src/gpx.c
+++ b/src/gpx.c
@@ -929,13 +929,12 @@ static void gpx_write_trackpoint ( VikTrackpoint *tp, GpxWritingContext *context
   if ( tp->altitude != VIK_DEFAULT_ALTITUDE )
   {
     a_coords_dtostr_buffer ( tp->altitude, s_alt );
+    fprintf ( f, "    <ele>%s</ele>\n", s_alt );
   }
   else if ( context->options != NULL && context->options->force_ele )
   {
-    a_coords_dtostr_buffer ( 0, s_alt );
+    fprintf ( f, "    <ele>0</ele>\n" );
   }
-  if (s_alt != NULL)
-    fprintf ( f, "    <ele>%s</ele>\n", s_alt );
   
   time_iso8601 = NULL;
   if ( tp->has_timestamp ) {