correctly zero sockaddr_in structure

This commit is contained in:
Radim Kolar 2014-09-09 07:37:46 +02:00
parent 6cdb983bf4
commit 863bff21a0
2 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@ Version NEXT
semicolon on separate line semicolon on separate line
FAQ: Cleaned lot of SGML markup errors FAQ: Cleaned lot of SGML markup errors
Do not use sgmlformat, call jade directly Do not use sgmlformat, call jade directly
correctly zero entire sockaddr_in structure during name resolving,
error found by clang.
Version 2.8.1b26 - 1 Oct 2009 Version 2.8.1b26 - 1 Oct 2009
fver now reports if server can process extra data in input packets. fver now reports if server can process extra data in input packets.

View File

@ -65,7 +65,7 @@ int _x_adr (const char *host, int port, struct sockaddr_in * his)
int i; int i;
char *s, *d; char *s, *d;
memset(his,0,sizeof(his)); memset(his,0,sizeof(struct sockaddr_in));
if(!host) { if(!host) {
gethostname(myhost,sizeof(myhost)); gethostname(myhost,sizeof(myhost));
host=myhost; host=myhost;