]> git.meshlink.io Git - catta/blobdiff - server.c
add support for dots and backslashes in domain names (required for DNS-SD)
[catta] / server.c
index 56e4d813600b53cd656866e1d84a390d98d5828f..cd97262afed8e6f80a4e8c105243c9f310b8b9d5 100644 (file)
--- a/server.c
+++ b/server.c
@@ -300,10 +300,9 @@ flxServer *flx_server_new(GMainContext *c) {
     
     /* Get host name */
     hn = flx_get_host_name();
-    if ((e = strchr(hn, '.')))
-        *e = 0;
+    hn[strcspn(hn, ".")] = 0;
 
-    s->hostname = g_strdup_printf("%s.local.", hn);
+    s->hostname = g_strdup_printf("%slocal.", hn);
     g_free(hn);
 
     add_default_entries(s);