diff options
author | Christian Hesse <mail@eworm.de> | 2016-09-30 09:15:55 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2016-09-30 09:15:55 +0200 |
commit | e86c874dbf0f88798688b5d7244e133c13e4a535 (patch) | |
tree | 01efb0c75707728f533ba6c4172d0f042f243ee3 | |
parent | 1e52ef295cff61cbc2dae72dbe3e409a66c0b302 (diff) | |
download | dyndhcpd-e86c874dbf0f88798688b5d7244e133c13e4a535.tar.gz dyndhcpd-e86c874dbf0f88798688b5d7244e133c13e4a535.tar.zst |
use HOST_NAME_MAX from limits.h
-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> |