diff options
-rw-r--r-- | dyndhcpd.c | 4 | ||||
-rw-r--r-- | dyndhcpd.h | 1 |
2 files changed, 3 insertions, 2 deletions
@@ -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++; @@ -14,6 +14,7 @@ #include <sys/socket.h> #include <net/if.h> #include <netdb.h> +#include <limits.h> #include <ifaddrs.h> #include <stdio.h> #include <stdlib.h> |