CVS: winex/dlls/iphlpapi iphlpapi_main.c, 1.13, 1.14
[email protected] 27 Jun 2007 12:09:55 -0000
| Newsgroups | gmane.comp.emulators.winex.cvs |
|---|---|
| Message-ID | <[email protected]> |
Subject: winex/dlls/iphlpapi iphlpapi_main.c,1.13,1.14Update of /var/lib/cvsd/cvsroot/winex/dlls/iphlpapi
In directory agravaine:/tmp/cvs-serv23714/dlls/iphlpapi
Modified Files:
iphlpapi_main.c
Log Message:
- fix sort order for little-endian machines
Index: iphlpapi_main.c
===================================================================
RCS file: /var/lib/cvsd/cvsroot/winex/dlls/iphlpapi/iphlpapi_main.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- iphlpapi_main.c 27 Jun 2007 11:45:04 -0000 1.13
+++ iphlpapi_main.c 27 Jun 2007 12:09:53 -0000 1.14
@@ -296,13 +296,15 @@
const MIB_TCPROW* rowA = a;
const MIB_TCPROW* rowB = b;
- ret = rowA->dwLocalAddr - rowB->dwLocalAddr;
+ ret = ntohl (rowA->dwLocalAddr) - ntohl (rowB->dwLocalAddr);
if (ret == 0) {
- ret = rowA->dwLocalPort - rowB->dwLocalPort;
+ ret = ntohs ((unsigned short)rowA->dwLocalPort) -
+ ntohs ((unsigned short)rowB->dwLocalPort);
if (ret == 0) {
- ret = rowA->dwRemoteAddr - rowB->dwRemoteAddr;
+ ret = ntohl (rowA->dwRemoteAddr) - ntohl (rowB->dwRemoteAddr);
if (ret == 0)
- ret = rowA->dwRemotePort - rowB->dwRemotePort;
+ ret = ntohs ((unsigned short)rowA->dwRemotePort) -
+ ntohs ((unsigned short)rowB->dwRemotePort);
}
}
}