tUse POSIX HOST_NAME_MAX, which is cleaner. - geomyidae - A small C-based gopherd. (gopher://bitreich.org/1/scm/geomyidae)
 (HTM) git clone git://r-36.net/geomyidae
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 3328e3e0954e74d3397246b26a0fcbccc9567e4e
 (DIR) parent d878002edce4e4a731a4936011e045f162d5c967
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Tue, 30 Oct 2018 20:48:04 +0100
       
       Use POSIX HOST_NAME_MAX, which is cleaner.
       
       Diffstat:
         main.c                              |       5 +++--
       
       1 file changed, 3 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/main.c b/main.c
       t@@ -23,6 +23,7 @@
        #include <grp.h>
        #include <errno.h>
        #include <arpa/inet.h>
       +#include <limits.h>
        
        #include "ind.h"
        #include "handlr.h"
       t@@ -455,8 +456,8 @@ main(int argc, char *argv[])
                        usage();
        
                if (ohost == NULL) {
       -                ohost = xcalloc(1, 513);
       -                if (gethostname(ohost, 512) < 0) {
       +                ohost = xcalloc(1, HOST_NAME_MAX+1);
       +                if (gethostname(ohost, HOST_NAME_MAX) < 0) {
                                perror("gethostname");
                                free(ohost);
                                return 1;