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.
Merge pull request #692 from jack-pappas/patch-2

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