aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-modem-location.c
diff options
context:
space:
mode:
authorTeijo Kinnunen <teijo.kinnunen@uros.com>2021-05-06 14:42:47 +0300
committerTeijo Kinnunen <teijo.kinnunen@uros.com>2021-05-17 12:46:52 +0300
commit44671ced03c422347d2cc6912b7b3a7136eb5d40 (patch)
treeb4dc7afde2615ee6b43f3daa15e5eb35931b8f81 /cli/mmcli-modem-location.c
parent879ec1a5d4418ae1dfc137844fd2c06a35ffeabf (diff)
cli,location: use mm_location_3gpp_get_operator_code() in location output
Diffstat (limited to 'cli/mmcli-modem-location.c')
-rw-r--r--cli/mmcli-modem-location.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/mmcli-modem-location.c b/cli/mmcli-modem-location.c
index cec3220a..21562a2a 100644
--- a/cli/mmcli-modem-location.c
+++ b/cli/mmcli-modem-location.c
@@ -530,8 +530,11 @@ get_location_process_reply (MMLocation3gpp *location_3gpp,
}
if (location_3gpp) {
- mcc = g_strdup_printf ("%u", mm_location_3gpp_get_mobile_country_code (location_3gpp));
- mnc = g_strdup_printf ("%u", mm_location_3gpp_get_mobile_network_code (location_3gpp));
+ const gchar *operator_code;
+
+ operator_code = mm_location_3gpp_get_operator_code (location_3gpp);
+ mcc = g_strndup (operator_code ? operator_code : "0", 3);
+ mnc = g_strdup (operator_code ? operator_code + 3 : "0");
lac = g_strdup_printf ("%04lX", mm_location_3gpp_get_location_area_code (location_3gpp));
tac = g_strdup_printf ("%04lX", mm_location_3gpp_get_tracking_area_code (location_3gpp));
cid = g_strdup_printf ("%08lX", mm_location_3gpp_get_cell_id (location_3gpp));