/* Find URL component for the device's deployment operations resource  */
static int hawkbit_find_deployment_base(struct hawkbit_ctl_res *res, char *deployment_base)
/* Find URL component for the device's deployment operations resource  */
static int hawkbit_find_deployment_base(struct hawkbit_ctl_res *res, char *deployment_base)
{
	const char *href;
	const char *helper;
	size_t len;
	href = res->_links.deploymentBase.href;
	if (!href) {
		*deployment_base = '\0';
		return 0;
	}
	LOG_DBG("_links.%s.href=%s", "deploymentBase", href);
	helper = strstr(href, "deploymentBase/");
	if (!helper) {
		LOG_ERR("Missing deploymentBase/ in href %s", href);
		return -EINVAL;
	}
	len = strlen(helper);
	if (len > DEPLOYMENT_BASE_SIZE - 1) {
		LOG_ERR("deploymentBase %s is too big (len %zu, max %zu)", helper, len,
			DEPLOYMENT_BASE_SIZE - 1);
		return -ENOMEM;
	}
	strncpy(deployment_base, helper, DEPLOYMENT_BASE_SIZE);
	return 0;
}