hostname-util: strip all trailing separators in hostname_cleanup() (#43077)

Fixes #43054.
This commit is contained in:
Armaan Sandhu
2026-07-20 16:35:12 +09:00
committed by GitHub
parent 13aec9fddf
commit 79f25def86
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ char* hostname_cleanup(char *s) {
hyphen = false;
}
if (d > s && IN_SET(d[-1], '-', '.'))
while (d > s && IN_SET(d[-1], '-', '.'))
/* The dot can occur at most once, but we might have multiple
* hyphens, hence the loop */
d--;