Use the NI_MAXHOST constant to initialize the size of the hostname buffer.

The NI_MAXHOST constant should be used when creating the hostname buffer to avoid potential buffer overflows.