int privilege_info_get_name_string_id(const char *privilege, char **name_string_id)
{
int index = 0;
- bool validStringFlag = false;
-
TryReturn(privilege != NULL, PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege is NULL");
for (index = 0; index < PRIVILEGE_NUM; index++)
TryReturn(*name_string_id != NULL, PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] Memory allocation failed.");
memcpy(*name_string_id, privilege_info_table[index].name_string_id, strlen(privilege_info_table[index].name_string_id));
- validStringFlag = true;
break;
}
}
int privilege_info_get_description_string_id(const char *privilege, char **description_string_id)
{
int index = 0;
- bool validStringFlag = false;
-
TryReturn(privilege != NULL, PRVMGR_ERR_INVALID_PARAMETER, "[PRVMGR_ERR_INVALID_PARAMETER] privilege is NULL");
for (index = 0; index < PRIVILEGE_NUM; index++)
TryReturn(*description_string_id != NULL, PRVMGR_ERR_OUT_OF_MEMORY, "[PRVMGR_ERR_OUT_OF_MEMORY] Memory allocation failed.");
memcpy(*description_string_id, privilege_info_table[index].description_string_id, strlen(privilege_info_table[index].description_string_id));
- validStringFlag = true;
break;
}
}
TryReturn(dbRes == SQLITE_DONE, res = PRIV_CHECKER_ERROR_DB_ERROR, PRIV_CHECKER_ERROR_DB_ERROR, "[%s] DB step failed. (%d)", Util::GetErrorMessage(PRIV_CHECKER_ERROR_DB_ERROR), dbRes);
LOGI("leave");
- return 0;
+ return res;
}
int