X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=avahi-common%2Futil.c;h=8be7b8830b90e4c856f2ab93878c77cadd7d5e22;hb=f43187377e0c89ba02ca23e88efa01bbb255e037;hp=c9a3143aac2163b67ceb751fd5487e1da5ff0c0d;hpb=ac082e8eb624bc5ae0c19e91f412c8c5f12bfddf;p=catta diff --git a/avahi-common/util.c b/avahi-common/util.c index c9a3143..8be7b88 100644 --- a/avahi-common/util.c +++ b/avahi-common/util.c @@ -84,13 +84,12 @@ gchar *avahi_normalize_name(const gchar *s) { unescape_uneeded(s, tmp, sizeof(tmp)); - if ((l = strlen(tmp)) == 0) - return g_strdup("."); + l = strlen(tmp); - if (tmp[l-1] == '.') - return g_strdup(tmp); + while (l > 0 && tmp[l-1] == '.') + tmp[--l] = 0; - return g_strdup_printf("%s.", tmp); + return g_strdup(tmp); } gint avahi_timeval_compare(const GTimeVal *a, const GTimeVal *b) {