socket_accept4 should cope with being passed NULL pointers
This commit is contained in:
parent
10658ebe60
commit
f141d3e24f
@ -13,7 +13,7 @@ int socket_accept4(int s,char *ip,uint16 *port) {
|
|||||||
int fd;
|
int fd;
|
||||||
if ((fd=accept(s,(void*) &si,&len))==-1)
|
if ((fd=accept(s,(void*) &si,&len))==-1)
|
||||||
return winsock2errno(-1);
|
return winsock2errno(-1);
|
||||||
*(uint32*)ip = *(uint32*)&si.sin_addr;
|
if (ip) *(uint32*)ip = *(uint32*)&si.sin_addr;
|
||||||
uint16_unpack_big((char *) &si.sin_port,port);
|
if (port) uint16_unpack_big((char *) &si.sin_port,port);
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user