X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/faa52bdcc0221de2d8fae950e409a8ac5e05bfcd..7e29da026b31f02c839b40c4dcf7bd87741a5e4a:/components/hostname.c

diff --git a/components/hostname.c b/components/hostname.c
index d7c10c8..d41465f 100644
--- a/components/hostname.c
+++ b/components/hostname.c
@@ -9,7 +9,7 @@
 const char *
 hostname(void)
 {
-	if (gethostname(buf, sizeof(buf)) == -1) {
+	if (gethostname(buf, sizeof(buf)) < 0) {
 		fprintf(stderr, "gethostbyname: %s\n", strerror(errno));
 		return NULL;
 	}