]> git.street.me.uk Git - andy/viking.git/blobdiff - src/gpx.c
Put vikutils.h into viking.h
[andy/viking.git] / 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 ) {