From e86c874dbf0f88798688b5d7244e133c13e4a535 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 30 Sep 2016 09:15:55 +0200 Subject: use HOST_NAME_MAX from limits.h --- dyndhcpd.c | 4 ++-- dyndhcpd.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dyndhcpd.c b/dyndhcpd.c index 134e845..135a018 100644 --- a/dyndhcpd.c +++ b/dyndhcpd.c @@ -41,7 +41,7 @@ int main(int argc, char ** argv) { struct network network, dhcp, bootp; char * interface = NULL; - char hostname[254]; + char hostname[HOST_NAME_MAX]; char * domainname; struct hostent *hp; @@ -108,7 +108,7 @@ int main(int argc, char ** argv) { } /* get the domainname */ - gethostname(hostname, 254); + gethostname(hostname, HOST_NAME_MAX); hp = gethostbyname(hostname); if ((domainname = strchr(hp->h_name, '.')) != NULL) domainname++; diff --git a/dyndhcpd.h b/dyndhcpd.h index cbcffb2..9a84b55 100644 --- a/dyndhcpd.h +++ b/dyndhcpd.h @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3-70-g09d2