mirror of https://github.com/xzeldon/htop.git
Ensure buffer for gethostname(2) is properly terminated
This commit is contained in:
parent
c5770c26af
commit
23c5b9ce3c
|
@ -13,4 +13,5 @@ in the source distribution for its full text.
|
||||||
|
|
||||||
void Generic_hostname(char* buffer, size_t size) {
|
void Generic_hostname(char* buffer, size_t size) {
|
||||||
gethostname(buffer, size - 1);
|
gethostname(buffer, size - 1);
|
||||||
|
buffer[size - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue