src/login_nopam.c: resolve_hostname(): Use NI_MAXHOST instead of MAXHOSTNAMELEN with getnameinfo(3)
That's what the getnameinfo(3) manual page recommends. Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
committed by
Serge Hallyn
parent
a65fccf199
commit
627b7364b5
+1
-1
@@ -262,7 +262,7 @@ static const char *resolve_hostname (const char *string)
|
||||
const char *addr_str;
|
||||
struct addrinfo *addrs;
|
||||
|
||||
static char host[MAXHOSTNAMELEN];
|
||||
static char host[NI_MAXHOST];
|
||||
|
||||
gai_err = getaddrinfo(string, NULL, NULL, &addrs);
|
||||
if (gai_err != 0) {
|
||||
|
||||
Reference in New Issue
Block a user