Update codes for gcc 9.2 compiler 25/222125/1 accepted/tizen/unified/20200113.130600 submit/tizen/20200110.075809
authorwn.jang <wn.jang@samsung.com>
Mon, 30 Dec 2019 05:12:03 +0000 (14:12 +0900)
committersungrae jo <seongrae.jo@samsung.com>
Fri, 10 Jan 2020 02:25:26 +0000 (02:25 +0000)
Change-Id: Ibc0e249fe887830978f3b001d70a84a0b794c032
(cherry picked from commit fe2387cfc75548de1aedc15bf5015fa35fee4610)

client/vc_mgr_dbus.c
common/vc_cmd_db.c
server/vcd_server.c

index 1750069..a95852c 100644 (file)
@@ -294,7 +294,7 @@ static Eina_Bool vc_mgr_listener_event_callback(void* data, Ecore_Fd_Handler *fd
                                if (NULL != err_msg && strcmp("#NULL", err_msg)) {
                                        temp_msg = strdup(err_msg);
                                }
-                               SLOG(LOG_ERROR, TAG_VCM, "@@ vc mgr Get Error message : reason(%d), daemon_pid(%d), msg(%s)", reason, daemon_pid, temp_msg);
+                               SLOG(LOG_ERROR, TAG_VCM, "@@ vc mgr Get Error message : reason(%d), daemon_pid(%d), msg(%s)", reason, daemon_pid, (temp_msg) ? temp_msg : "NULL");
                                __vc_mgr_cb_error(reason, daemon_pid, temp_msg);
                                if (NULL != temp_msg) {
                                        free(temp_msg);
index ad72839..62edb6c 100644 (file)
@@ -789,11 +789,10 @@ static int __vc_db_remove_invocation_name(char* org_cmd, const char* invocation_
                SLOG(LOG_WARN, vc_db_tag(), "[WARNING] No need to remove invocation name, org_cmd(%s) invocation(%s)", org_cmd, invocation_name);
                return VC_DB_ERROR_INVALID_PARAMETER;
        }
-
        if (0 == strncasecmp(org_cmd, invocation_name, strlen(invocation_name))) {
                *new_cmd = strdup(org_cmd + strlen(invocation_name) + 1);
        }
-       SLOG(LOG_DEBUG, vc_db_tag(), "Original cmd[%s], New cmd[%s], Invocation name[%s]", org_cmd, *new_cmd, invocation_name);
+       SLOG(LOG_INFO, vc_db_tag(), "Original cmd[%s], New cmd[%s], Invocation name[%s]", org_cmd, (*new_cmd) ? *new_cmd : "NULL", invocation_name);
        return VC_DB_ERROR_NONE;
 }
 
@@ -822,8 +821,9 @@ static int __vc_db_extract_unfixed_command(char* command, char* fixed, char** te
        if (0 == strncasecmp(command, fixed, strlen(fixed))) {
                strncpy(temp, command + strlen(fixed) + 1, strlen(command) - strlen(fixed) - 1);
                SLOG(LOG_WARN, vc_db_tag(), "@@@");
-       } else  if (0 == strncasecmp(command + strlen(command) - strlen(fixed), fixed, strlen(fixed))) {
-               strncpy(temp, command, strlen(command) - strlen(fixed) - 1);
+       } else  if (0 == strncasecmp(command + strlen(command) - strlen(fixed), fixed, strlen(fixed))) {
+               command[strlen(command) - strlen(fixed) - 1] = '\0';
+               snprintf(temp, 256, "%s", command);
                SLOG(LOG_WARN, vc_db_tag(), "@@@");
        }
 
@@ -1553,7 +1553,7 @@ int __vc_db_open_db_for_daemon(char** path, sqlite3** db_handle)
 
        if (*db_handle) {
                char* err_msg = NULL;
-               static const const char* sql = "PRAGMA journal_mode = WAL";
+               static const char* sql = "PRAGMA journal_mode = WAL";
                int ret = sqlite3_exec(*db_handle, sql, NULL, NULL, &err_msg);
                if (ret != SQLITE_OK) {
                        SLOG(LOG_ERROR, vc_db_tag(), "sqlite3_exec returned %d: %s", ret, err_msg);
index 77e0ff8..5a54f55 100644 (file)
@@ -1191,14 +1191,14 @@ static void __vcd_file_clean_up()
                return;
        }
 
-       char remove_path[256] = {0, };
+       char remove_path[257] = {0, };
        do {
                dirp = readdir(dp);
 
                if (NULL != dirp) {
                        if (!strncmp("vc_", dirp->d_name, strlen("vc_"))) {
-                               memset(remove_path, 0, 256);
-                               snprintf(remove_path, 256, "%s/%s", VC_RUNTIME_INFO_ROOT, dirp->d_name);
+                               memset(remove_path, 0, 257);
+                               snprintf(remove_path, 257, "%s/%s", VC_RUNTIME_INFO_ROOT, dirp->d_name);
 
                                /* Clean up code */
                                if (0 != remove(remove_path)) {