From c5dee64de02c9f47674f64dc08c9e11a7c678522 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 20 May 2005 06:59:31 +0000 Subject: Avoid potential divide-by-zero error. --- nmea_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nmea_parse.c') diff --git a/nmea_parse.c b/nmea_parse.c index 7c29efd0..ba6a56c8 100644 --- a/nmea_parse.c +++ b/nmea_parse.c @@ -274,7 +274,7 @@ static int processGPGGA(int c UNUSED, char *field[], struct gps_data_t *out) * SiRF and Garmin chips, which might have some smoothing * going on. */ - if (oldaltitude == ALTITUDE_NOT_VALID) + if (oldaltitude == ALTITUDE_NOT_VALID || out->fix.time==oldfixtime) out->fix.climb = 0; else { out->fix.climb = (out->fix.altitude-oldaltitude)/(out->fix.time-oldfixtime); -- cgit v1.2.1