From 4e2d82b18f7e099cbce933b383c45efa40306161 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 24 Apr 2005 20:23:07 +0000 Subject: add support for dots and backslashes in domain names (required for DNS-SD) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@28 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- server.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'server.c') diff --git a/server.c b/server.c index 56e4d81..cd97262 100644 --- 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); -- cgit