mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-25 15:25:45 +00:00
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) {
|
||||
gethostname(buffer, size - 1);
|
||||
buffer[size - 1] = '\0';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user