Fix BT_ERR log msg and strncpy build error 12/221012/6 accepted/tizen/unified/20200101.120617 submit/tizen/20191230.003618
authorAmit Purwar <amit.purwar@samsung.com>
Thu, 26 Dec 2019 09:21:35 +0000 (14:51 +0530)
committerAmit Purwar <amit.purwar@samsung.com>
Fri, 27 Dec 2019 06:36:49 +0000 (12:06 +0530)
Change-Id: Icf1ece9e60678c01ab6c178d3f300318cc921f3a
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
src/bluetooth-adapter.c
test/bt_unit_test.c

index 348a5ae..e3458e0 100644 (file)
@@ -326,14 +326,14 @@ int bt_adapter_get_local_info(char **chipset, char **firmware,
 
                info_start = strstr(buf, "bluetooth");
                if (info_start == NULL) {
-                       BT_ERR("strstr() error(%s)", info_start);
+                       BT_ERR("strstr() error info_start is NULL");
                        ret = BT_ERROR_OPERATION_FAILED;
                        goto ERROR;
                }
                info_start += 10;
                info_end = strstr(buf, "hcd");
                if (info_end == NULL) {
-                       BT_ERR("strstr() error(%s)", info_end);
+                       BT_ERR("strstr() error info_end is NULL");
                        ret = BT_ERROR_OPERATION_FAILED;
                        goto ERROR;
                }
@@ -357,7 +357,7 @@ int bt_adapter_get_local_info(char **chipset, char **firmware,
 
                info_end = strchr(buf, '_');
                if (info_end == NULL) {
-                       BT_ERR("strchr() error(%s)", info_end);
+                       BT_ERR("strchr() error info_end is NULL");
                        ret = BT_ERROR_OPERATION_FAILED;
                        goto ERROR;
                }
@@ -412,7 +412,7 @@ int bt_adapter_get_local_info(char **chipset, char **firmware,
        info_start = buf;
        info_end = strchr(buf, ',');
        if (info_end == NULL) {
-               BT_ERR("strchr() error(%s)", info_end);
+               BT_ERR("strchr() error info_end is NULL");
                ret = BT_ERROR_OPERATION_FAILED;
                goto ERROR;
        }
index 1d859b8..7ff1449 100644 (file)
@@ -4096,10 +4096,9 @@ done:
 
                if (param_index > 0) {
                        int len = strlen(param);
-                       g_test_param.params[param_index - 1] = g_malloc0(len + 1);
                        /* Remove new line character */
                        param[len - 1] = '\0';
-                       strncpy(g_test_param.params[param_index - 1], param, strlen(param));
+                       g_test_param.params[param_index - 1] = g_strdup(param);
                }
 
                if (param_index  == g_test_param.param_count) {