aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--asroot.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/asroot.c b/asroot.c
index be28d13..193926d 100644
--- a/asroot.c
+++ b/asroot.c
@@ -241,7 +241,8 @@ check_password(void)
}
*hostname = 0;
if (!gethostname(hostname, size)) {
- break;
+ if (!hostname[size - 2])
+ break;
} else if (errno != ENAMETOOLONG) {
fprintf(stderr, "%s: gethostname %zu: %s\n", argv0, size, strerror(errno));
exit(EXIT_ERROR);