NULL-values are compared correctly.
FossilOrigin-Name: 4094a71e1101a2d7032763ed882738d5ea770e71d474ea0c80122166e3f8563d
This commit is contained in:
parent
0dd9f008ff
commit
ea622e211e
@ -47,14 +47,17 @@ int sock_cmpaddr(const struct sockaddr *addr1, const struct sockaddr *addr2,int
|
||||
int p1,p2;
|
||||
int slen;
|
||||
|
||||
if (!addr1){
|
||||
if (!addr1 && addr2){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!addr2){
|
||||
return -1;
|
||||
if (!addr2 && addr1){
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!addr1 && !addr2)
|
||||
return 0;
|
||||
|
||||
if (addr1->sa_family != addr2->sa_family){
|
||||
return addr1->sa_family - addr2->sa_family;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user