int cil_fill_integer64(struct cil_tree_node *int_node, uint64_t *integer, int base)
{
	int rc = SEPOL_ERR;
	char *endptr = NULL;
	uint64_t val;

	if (int_node == NULL || int_node->data == NULL || integer == NULL) {
		goto exit;
	}

	errno = 0;
	val = strtoull(int_node->data, &endptr, base);
	if (errno != 0 || endptr == int_node->data || *endptr != '\0') {
		rc = SEPOL_ERR;
		goto exit;
	}

	*integer = val;

	return SEPOL_OK;

exit:
	cil_log(CIL_ERR, "Failed to create integer from string\n");
	return rc;
}
int cil_fill_integer64(struct cil_tree_node *int_node, uint64_t *integer, int base)
{
	int rc = SEPOL_ERR;
	char *endptr = NULL;
	uint64_t val;

	if (int_node == NULL || int_node->data == NULL || integer == NULL) {
		goto exit;
	}

	errno = 0;
	val = strtoull(int_node->data, &endptr, base);
	if (errno != 0 || endptr == int_node->data || *endptr != '\0') {
		rc = SEPOL_ERR;
		goto exit;
	}

	*integer = val;

	return SEPOL_OK;

exit:
	cil_log(CIL_ERR, "Failed to create integer from string\n");
	return rc;
}