1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Check for empty fields during lat/lon conversion (invalid GPS fix)

This commit is contained in:
Werner Backes 2012-05-01 23:34:32 +02:00 committed by James Cotton
parent fb53d5621a
commit 217860c187

View File

@ -234,6 +234,10 @@ static bool NMEA_latlon_to_fixed_point(int32_t * latlon, char *nmea_latlon, bool
PIOS_DEBUG_Assert(nmea_latlon); PIOS_DEBUG_Assert(nmea_latlon);
PIOS_DEBUG_Assert(latlon); PIOS_DEBUG_Assert(latlon);
if (*nmea_latlon == '\0') { /* empty lat/lon field */
return false;
}
if (!NMEA_parse_real(&num_DDDMM, &num_m, &units, nmea_latlon)) { if (!NMEA_parse_real(&num_DDDMM, &num_m, &units, nmea_latlon)) {
return false; return false;
} }