Browse Source

socket_accept4 should cope with being passed NULL pointers

master
Felix von Leitner 16 years ago
parent
commit
fef6c061ce
  1. 4
      socket/socket_accept4.c

4
socket/socket_accept4.c

@ -13,7 +13,7 @@ int socket_accept4(int s,char *ip,uint16 *port) {
int fd;
if ((fd=accept(s,(void*) &si,&len))==-1)
return winsock2errno(-1);
*(uint32*)ip = *(uint32*)&si.sin_addr;
uint16_unpack_big((char *) &si.sin_port,port);
if (ip) *(uint32*)ip = *(uint32*)&si.sin_addr;
if (port) uint16_unpack_big((char *) &si.sin_port,port);
return fd;
}

Loading…
Cancel
Save