1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Declare addrlen as int. Published in <sxsu27cbtzu.fsf@florida.arsdigita.de>.

This commit is contained in:
hniksic 2001-01-10 07:06:00 -08:00
parent 17e21ff7dd
commit 3f91c7dfe1
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2001-01-06 Hrvoje Niksic <hniksic@arsdigita.com>
* connect.c (bindport): Declare addrlen as int. Diagnosed by
Drazen Kacar <dave@arsdigita.com>.
(conaddr): Ditto.
2001-01-09 Dan Harkless <wget@harkless.org> 2001-01-09 Dan Harkless <wget@harkless.org>
* html-url.c: A bunch of fixup of `--page-requisites'-related * html-url.c: A bunch of fixup of `--page-requisites'-related

View File

@ -176,8 +176,11 @@ bindport (unsigned short *port)
DEBUGP (("Master socket fd %d bound.\n", msock)); DEBUGP (("Master socket fd %d bound.\n", msock));
if (!*port) if (!*port)
{ {
size_t addrlen = sizeof (struct sockaddr_in); /* #### addrlen should be a 32-bit type, which int is not
if (getsockname (msock, addr, (int *)&addrlen) < 0) guaranteed to be. Oh, and don't try to make it a size_t,
because that can be 64-bit. */
int addrlen = sizeof (struct sockaddr_in);
if (getsockname (msock, addr, &addrlen) < 0)
{ {
CLOSE (msock); CLOSE (msock);
msock = -1; msock = -1;
@ -260,7 +263,8 @@ conaddr (int fd)
static unsigned char res[4]; static unsigned char res[4];
struct sockaddr_in mysrv; struct sockaddr_in mysrv;
struct sockaddr *myaddr; struct sockaddr *myaddr;
size_t addrlen = sizeof (mysrv); int addrlen = sizeof (mysrv); /* see bindport() for discussion of
using `int' here. */
myaddr = (struct sockaddr *) (&mysrv); myaddr = (struct sockaddr *) (&mysrv);
if (getsockname (fd, myaddr, (int *)&addrlen) < 0) if (getsockname (fd, myaddr, (int *)&addrlen) < 0)