if (filter == NULL)
return PMINFO_R_OK;
- len += strlen(" WHERE 1=1 ");
strncat(buf, " WHERE 1=1 ", MAX_QUERY_LEN - len - 1);
+ len += strlen(" WHERE 1=1 ");
for (list = filter->list; list; list = list->next) {
joined |= __get_filter_condition(list->data, uid, &condition,
bind_params);
if (condition == NULL)
continue;
- len += strlen(" AND ");
strncat(buf, " AND ", MAX_QUERY_LEN - len - 1);
+ len += strlen(" AND ");
- len += strlen(condition);
strncat(buf, condition, sizeof(buf) - len - 1);
+ len += strlen(condition);
free(condition);
condition = NULL;
}
author_x *author = NULL;
GList *bind_params = NULL;
sqlite3 *db;
- sqlite3_stmt *stmt;
+ sqlite3_stmt *stmt = NULL;
pkgmgrinfo_filter_x *tmp_filter = NULL;
bool is_check_storage = true;
g_list_free_full(bind_params, free);
sqlite3_close_v2(db);
- sqlite3_finalize(stmt);
+ if (stmt)
+ sqlite3_finalize(stmt);
return ret;
}
return PMINFO_R_OK;
}
+API int pkgmgrinfo_pkginfo_get_external_image_path(pkgmgrinfo_pkginfo_h handle, char **ext_image_path)
+{
+ pkgmgr_pkginfo_x *info = (pkgmgr_pkginfo_x *)handle;
+
+ retvm_if(handle == NULL, PMINFO_R_EINVAL, "pkginfo handle is NULL\n");
+ retvm_if(ext_image_path == NULL, PMINFO_R_EINVAL, "Argument supplied to hold return value is NULL\n");
+
+ if (info->pkg_info == NULL)
+ return PMINFO_R_ERROR;
+
+ if (info->pkg_info->external_path == NULL)
+ return PMINFO_R_ENOENT;
+
+ *ext_image_path = (char *)info->pkg_info->external_path;
+
+ return PMINFO_R_OK;
+}
+
API int pkgmgrinfo_pkginfo_get_install_location(pkgmgrinfo_pkginfo_h handle, pkgmgrinfo_install_location *location)
{
char *val;