Support missing elevation -> bad tag
authorDaniel Silverstone <dsilvers@svn.openstreetmap.org>
Tue, 11 Nov 2008 14:01:39 +0000 (14:01 +0000)
committerDaniel Silverstone <dsilvers@svn.openstreetmap.org>
Tue, 11 Nov 2008 14:01:39 +0000 (14:01 +0000)
src/gpx.c

index a79c28b..92ebf12 100644 (file)
--- a/src/gpx.c
+++ b/src/gpx.c
@@ -282,7 +282,7 @@ gpx_handle_end_element(void *_ctx, const XML_Char *name)
     if (ctx->state == WAYPOINT)
       return;
     REQUIRE_STATE(ELEVATION);
-    ctx->point->elevation = strtof(ctx->accumulator, NULL);
+    ctx->point->elevation = strtof(ctx->accumulator ? ctx->accumulator : "", NULL);
     ctx->state = TRACKPOINT;
     ctx->got_ele = true;
   } else if (strcmp(name, "time") == 0) {