diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-02-29 16:05:48 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-02-29 16:05:48 +0100 |
commit | 2e8294bc20eb1c9e87946aaee29d55d337d24cd9 (patch) | |
tree | 89d64685b87436ac0c4f6492d89c248b65009e6c /src/basic | |
parent | 0522e11f59482e051dcdaff47ab05a781c8447a0 (diff) | |
parent | 46e1a2278116e2f5067c35127ccbd8589335f734 (diff) |
Merge pull request #2763 from tblume/shorten-hostname-before-removing-dots
shorten hostname before checking for trailing dot
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/hostname-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index 3cd2f2c872..5a7ee87a20 100644 --- a/src/basic/hostname-util.c +++ b/src/basic/hostname-util.c @@ -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; } |