Fix the build error for execv function 65/223265/1 accepted/tizen/unified/20200129.022658 submit/tizen/20200127.235706
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Jan 2020 06:06:48 +0000 (15:06 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Jan 2020 06:06:48 +0000 (15:06 +0900)
error: argument 2 null where non-null expected [-Werror=nonnull]

Change-Id: I52334cd5f2fa1655031c1cc1745948e163caba94
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-core/bt-core-adapter.c

index be41307..8481d86 100644 (file)
@@ -184,7 +184,12 @@ static int __execute_command(const char *cmd, char *const arg_list[])
                if (pid2 == -1) {
                        BT_ERR("fork failed");
                } else if (pid2 == 0) {
-                       execv(cmd, arg_list);
+                       if (arg_list != NULL) {
+                               execv(cmd, arg_list);
+                       } else {
+                               char *argv[] = { NULL };
+                               execv(cmd, argv);
+                       }
                        exit(256);
                }
                exit(0);