From: robertl Date: Sun, 20 Jun 2010 00:03:31 +0000 (+0000) Subject: Negative time points are always out of bound in track filter. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~975 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=0c23b99224db89bb511c4f77419f8a89ec1c14b0;p=gpsbabel.git Negative time points are always out of bound in track filter. --- diff --git a/gpsbabel/trackfilter.c b/gpsbabel/trackfilter.c index b5d2e2b2d..1e47ec3bf 100644 --- a/gpsbabel/trackfilter.c +++ b/gpsbabel/trackfilter.c @@ -864,10 +864,14 @@ trackfilter_range(void) /* returns number of track points left after filtering QUEUE_FOR_EACH((queue *)&track->waypoint_list, elem, tmp) { waypoint *wpt = (waypoint *)elem; - if (wpt->creation_time > 0) { inside = ((wpt->creation_time >= start) && (wpt->creation_time <= stop)); } + // If the time is mangled so horribly that it's + // negative, toss it. + if (wpt->creation_time < 0) { + inside = 0; + } if (! inside) { track_del_wpt(track, wpt);