hostnamectl: rework pretty hostname validation (#3985)

Rework 17eb9a9ddb a bit.

Let's make sure we don't clobber the input parameter args[1], following our
coding style to not clobber parameters unless explicitly indicated. (in
particular, as we don't want to have our changes appear in the command line
shown in "ps"...)

No functional change.
This commit is contained in:
Lennart Poettering
2016-08-18 21:16:16 -04:00
committed by Zbigniew Jędrzejewski-Szmek
parent 622a0f628c
commit 2ae0858e6c
2 changed files with 19 additions and 18 deletions
-1
View File
@@ -163,7 +163,6 @@ char* hostname_cleanup(char *s) {
*(d++) = *p;
dot = false;
}
}
if (dot && d > s)