fix add presence cb (strncmp(NULL, ...)) 79/87179/1
authoryoungman <yman.jung@samsung.com>
Tue, 6 Sep 2016 23:00:32 +0000 (08:00 +0900)
committeryoungman <yman.jung@samsung.com>
Tue, 6 Sep 2016 23:00:32 +0000 (08:00 +0900)
Change-Id: Iea8ef4defaadf5fbd1310c6bb45787689cc4a3a0

src/ic-ioty.c

index 43464c7..1c25a38 100644 (file)
@@ -634,9 +634,9 @@ int icl_ioty_add_presence_cb(const char *host_address,
        else
                address = host_address;
 
-       if (IC_EQUAL == strncmp(IC_COAPS, host_address, strlen(IC_COAPS)))
+       if (IC_EQUAL == strncmp(IC_COAPS, address, strlen(IC_COAPS)))
                index = strlen(IC_COAPS);
-       else if (IC_EQUAL == strncmp(IC_COAP, host_address , strlen(IC_COAP)))
+       else if (IC_EQUAL == strncmp(IC_COAP, address, strlen(IC_COAP)))
                index = strlen(IC_COAP);
 
        snprintf(uri, sizeof(uri), "%s%s", &address[index], OC_RSRVD_PRESENCE_URI);