diff --git a/generic/hostname.c b/generic/hostname.c index 78404e43..2e3d5c31 100644 --- a/generic/hostname.c +++ b/generic/hostname.c @@ -13,4 +13,5 @@ in the source distribution for its full text. void Generic_hostname(char* buffer, size_t size) { gethostname(buffer, size - 1); + buffer[size - 1] = '\0'; }