| 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(-)
--- |
| 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) { |