summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2018-11-11 19:14:22 -0800
committerMatt Ranostay <matt.ranostay@konsulko.com>2018-11-21 13:43:43 -0800
commita7c4936942fad1890bab6d594b54f80f0cd89bc7 (patch)
tree4a4b264d8e6644f7f5f7a5ac36e7da4562a8c666
parent4a780082fa5aa993ec2c38cb1d3d92ea5b069950 (diff)
binding: telephony: fix segfaulting when modem is connected
Serial field isn't always passed if the device isn't connected causing a segfault when strcmp() is called. Change-Id: I0be1d9270a66df099786170136913a4b5525d582 Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
-rw-r--r--binding/gdbus/ofono_manager.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/binding/gdbus/ofono_manager.c b/binding/gdbus/ofono_manager.c
index ebe1412..1086beb 100644
--- a/binding/gdbus/ofono_manager.c
+++ b/binding/gdbus/ofono_manager.c
@@ -70,7 +70,7 @@ int ofono_manager_set_default_modem(const char *address)
type = g_variant_get_string(value, NULL);
}
/* If the HFP modem matches the BT address, is powered, and online then set as default */
- if (!strcmp(type, "hfp") && !strcmp(address, serial) && powered && online) {
+ if (!g_strcmp0(type, "hfp") && !g_strcmp0(address, serial) && powered && online) {
default_modem.address = serial;
default_modem.path = path;
default_modem.name = name;