]> git.meshlink.io Git - catta/blobdiff - server.c
* improve dns.c testing program
[catta] / server.c
index 56e4d813600b53cd656866e1d84a390d98d5828f..0b1a1238704b79f6149d8b4a6628baef754a1595 100644 (file)
--- a/server.c
+++ b/server.c
@@ -300,8 +300,7 @@ 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);
     g_free(hn);