From: Saurav Babu Date: Tue, 10 Apr 2018 12:39:27 +0000 (+0530) Subject: capi: Fixed random crashes due to device_type initialized with 0 X-Git-Tag: submit/tizen/20190131.065036~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b9c526e535514477dd4ece73d1812ad7d371935;p=platform%2Fcore%2Fapi%2Fmulti-device-group.git capi: Fixed random crashes due to device_type initialized with 0 Signed-off-by: Saurav Babu --- diff --git a/capi/demo/comp-manager.c b/capi/demo/comp-manager.c index 1ae75e5..c119b5a 100644 --- a/capi/demo/comp-manager.c +++ b/capi/demo/comp-manager.c @@ -278,7 +278,7 @@ static int run_devices_show(MManager *mm, struct menu_data *menu) companion_device_information_get_ip(device, &ip); companion_device_information_get_device_type(device, &devicetype); msgp("[%d] deviceid: %s, IP: %s type: %s", i+1, deviceid, ip, - devicetype); + __device_type_to_string(devicetype)); if (deviceid) { free(deviceid); diff --git a/capi/src/companion.c b/capi/src/companion.c index 4e320a6..7bc28f6 100644 --- a/capi/src/companion.c +++ b/capi/src/companion.c @@ -372,7 +372,7 @@ EXPORT_API int companion_device_get_found_devices(companion_h handle, while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { char *deviceid = NULL; char *addr = NULL; - int device_type = 0; + int device_type = COMPANION_DEVICE_TYPE_REMOTE; int port; int sec_port; companion_device_s *device = NULL; @@ -438,7 +438,7 @@ EXPORT_API int companion_device_get_found_mowned_devices( while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { char *deviceid = NULL; char *addr = NULL; - int device_type = 0; + int device_type = COMPANION_DEVICE_TYPE_REMOTE; int port; int sec_port; companion_device_s *device = NULL; @@ -497,7 +497,7 @@ EXPORT_API int companion_device_information_get_my_device(companion_h handle, GVariant *key_value = NULL; char *deviceid = NULL; char *addr = NULL; - int device_type = 0; + int device_type = COMPANION_DEVICE_TYPE_REMOTE; int port = -1; int sec_port = -1; diff --git a/capi/src/companion_dbus.c b/capi/src/companion_dbus.c index c33e6d1..d0f2dfd 100644 --- a/capi/src/companion_dbus.c +++ b/capi/src/companion_dbus.c @@ -106,7 +106,7 @@ static void __device_found_cb(Group *object, gint count, GVariant *va, while (g_variant_iter_next(iter, "a{sv}", &iter_row)) { char *device_id = NULL; char *ip = NULL; - int device_type = 0; + int device_type = COMPANION_DEVICE_TYPE_REMOTE; int port = -1; int sec_port = -1;