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);
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;
}
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(), "@@@");
}
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);
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)) {