summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Talbot <chris@talbothome.com>2023-06-13 06:32:20 -0400
committerTeemu Ikonen <tpikonen@mailbox.org>2023-06-17 16:08:48 +0000
commitdf7018f39f30a1cbc60f712f2d1c33d26695f04d (patch)
tree2c28d9f7cc4b79ff89ba3da32bdf02e66ea907eb
parent411e8b0872aa934b3ba44cea9e687bfddd85904c (diff)
gclue-location: remove error from gclue_location_create_from_rmc ()
-rw-r--r--src/gclue-location.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/gclue-location.c b/src/gclue-location.c
index 06f74dd..823231a 100644
--- a/src/gclue-location.c
+++ b/src/gclue-location.c
@@ -644,8 +644,7 @@ gclue_location_create_from_gga (const char *gga, GError **error)
static GClueLocation *
gclue_location_create_from_rmc (const char *rmc,
- GClueLocation *prev_location,
- GError **error)
+ GClueLocation *prev_location)
{
GClueLocation *location;
g_auto(GStrv) parts = NULL;
@@ -653,8 +652,10 @@ gclue_location_create_from_rmc (const char *rmc,
gdouble altitude;
parts = g_strsplit (rmc, ",", -1);
- if (g_strv_length (parts) < 13)
- goto error;
+ if (g_strv_length (parts) < 13) {
+ g_warning ("Invalid NMEA RMC sentence.");
+ return NULL;
+ }
/* RMC sentence is invalid */
if (g_strcmp0 (parts[3], "A") != 0)
@@ -665,7 +666,7 @@ gclue_location_create_from_rmc (const char *rmc,
gdouble lon = parse_coordinate_string (parts[5], parts[6]);
if (lat == INVALID_COORDINATE || lon == INVALID_COORDINATE)
- goto error;
+ return NULL;
gdouble speed = GCLUE_LOCATION_SPEED_UNKNOWN;
if (parts[7][0] != '\0')
@@ -710,13 +711,6 @@ gclue_location_create_from_rmc (const char *rmc,
NULL);
return location;
-
-error:
- g_set_error_literal (error,
- G_IO_ERROR,
- G_IO_ERROR_INVALID_ARGUMENT,
- "Invalid NMEA RMC sentence");
- return NULL;
}
/**
@@ -746,7 +740,7 @@ gclue_location_create_from_nmeas (const char *nmeas[],
gga_loc = gclue_location_create_from_gga (*iter, NULL);
if (!rmc_loc && gclue_nmea_type_is (*iter, "RMC"))
rmc_loc = gclue_location_create_from_rmc
- (*iter, prev_location, NULL);
+ (*iter, prev_location);
if (gga_loc && rmc_loc)
break;
}