use HOST_NAME_MAX to size buffers for gethostname(2)
authorRené Scharfe <l.s.r@web.de>
Tue, 18 Apr 2017 21:57:42 +0000 (17:57 -0400)
committerJunio C Hamano <gitster@pobox.com>
Wed, 19 Apr 2017 02:57:41 +0000 (19:57 -0700)
POSIX limits the length of host names to HOST_NAME_MAX. Export the
fallback definition from daemon.c and use this constant to make all
buffers used with gethostname(2) big enough for any possible result
and a terminating NUL.

Inspired-by: David Turner <dturner@twosigma.com>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: David Turner <dturner@twosigma.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found