From 138b3dabc23f7e56adccbd76c42d9136af5b4329 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sat, 19 Dec 2015 14:07:10 +0100 Subject: cli: validate SUPL server before showing it --- cli/mmcli-modem-location.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/mmcli-modem-location.c b/cli/mmcli-modem-location.c index 539f8bcf7..3425789fe 100644 --- a/cli/mmcli-modem-location.c +++ b/cli/mmcli-modem-location.c @@ -301,10 +301,14 @@ print_location_status (void) mm_modem_location_signals_location (ctx->modem_location) ? "yes" : "no"); /* If A-GPS supported, show SUPL server setup */ - if (mm_modem_location_get_capabilities (ctx->modem_location) & MM_MODEM_LOCATION_SOURCE_AGPS) + if (mm_modem_location_get_capabilities (ctx->modem_location) & MM_MODEM_LOCATION_SOURCE_AGPS) { + const gchar *supl_server; + + supl_server = mm_modem_location_get_supl_server (ctx->modem_location); g_print (" ----------------------------\n" " A-GPS | SUPL server: '%s'\n", - mm_modem_location_get_supl_server (ctx->modem_location)); + supl_server ? supl_server : "unset"); + } /* If GPS supported, show GPS refresh rate */ if (mm_modem_location_get_capabilities (ctx->modem_location) & (MM_MODEM_LOCATION_SOURCE_GPS_RAW | -- cgit v1.2.1