goto fail;
}
- path = malloc(strlen(tvheadend_webroot) + 6);
- sprintf(path, "path=%s", tvheadend_webroot);
+ if (tvheadend_webroot) {
+ path = malloc(strlen(tvheadend_webroot) + 6);
+ sprintf(path, "path=%s", tvheadend_webroot);
+ } else {
+ path = "/";
+ }
/* Add the service for HTTP */
if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC,
path,
NULL)) < 0) {
- free(path);
+ if (tvheadend_webroot)
+ free(path);
if (ret == AVAHI_ERR_COLLISION)
goto collision;
bonjour_init(void)
{
txt_rec_t txt_rec_http[] = {
- { "path", tvheadend_webroot },
+ { "path", tvheadend_webroot ? tvheadend_webroot : "/" },
{ .key = NULL }
};