Merge pull request #2763 from tblume/shorten-hostname-before-removing-dots

shorten hostname before checking for trailing dot
This commit is contained in:
Lennart Poettering
2016-02-29 16:05:48 +01:00
+2 -2
View File
@@ -150,6 +150,8 @@ char* hostname_cleanup(char *s) {
assert(s);
strshorten(s, HOST_NAME_MAX);
for (p = s, d = s, dot = true; *p; p++) {
if (*p == '.') {
if (dot)
@@ -169,8 +171,6 @@ char* hostname_cleanup(char *s) {
else
*d = 0;
strshorten(s, HOST_NAME_MAX);
return s;
}