1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-26 03:22:00 +03:00

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
commit 2e8294bc20

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;
}