tfix pedantic usage address_len parameter in accept(2) - 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 f02d57cfae2c18951b665353b21aed02d29731a9
 (DIR) parent cb9b6b70dbc6b33cc29364ba31023ffeb0579085
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Wed, 29 Aug 2018 20:22:19 +0200
       
       fix pedantic usage address_len parameter in accept(2)
       
       POSIX says regarding `address_len`:
       "on input specifies the length of the supplied sockaddr structure, and on
       output specifies the length of the stored address."
       
       So it should be set to the sizeof the used structure.
       
       Signed-off-by: Christoph Lohmann <20h@r-36.net>
       
       Diffstat:
         main.c                              |       3 +--
       
       1 file changed, 1 insertion(+), 2 deletions(-)
       ---
 (DIR) diff --git a/main.c b/main.c
       t@@ -533,8 +533,6 @@ main(int argc, char *argv[])
        
                initsignals();
        
       -        cltlen = sizeof(clt);
       -
        #ifdef __OpenBSD__
                char promises[31]; /* check the size needed in the fork too */
                snprintf(promises, sizeof(promises), "rpath inet stdio proc exec %s",
       t@@ -546,6 +544,7 @@ main(int argc, char *argv[])
        #endif /* __OpenBSD__ */
        
                while (1) {
       +                cltlen = sizeof(clt);
                        sock = accept(listfd, (struct sockaddr *)&clt, &cltlen);
                        if (sock < 0) {
                                switch (errno) {