Do not use HOST_NAME_MAX, NetBSD does not have it. - geomyidae - A small C-based gopherd.
git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
Log
Files
Refs
Tags
README
LICENSE
---
commit 904c8907275f13139e91bf1c3179f745d69f7fac
parent fd891de55bff0439c95c8eb1008f7055785a3886
Author: Christoph Lohmann <20h@r-36.net>
Date:   Mon, 12 Nov 2018 22:34:30 +0100

Do not use HOST_NAME_MAX, NetBSD does not have it.

Diffstat:
  M main.c                              |       6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/main.c b/main.c
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -481,8 +480,9 @@ main(int argc, char *argv[])
                 usage();
 
         if (ohost == NULL) {
-                ohost = xcalloc(1, HOST_NAME_MAX+1);
-                if (gethostname(ohost, HOST_NAME_MAX) < 0) {
+                /* Do not use MAX_NAME_HOST, it is not defined on NetBSD. */
+                ohost = xcalloc(1, 256+1);
+                if (gethostname(ohost, 256) < 0) {
                         perror("gethostname");
                         free(ohost);
                         return 1;