fix ssdpDiscoverDevices() when building for DEBUG under WIN32

This commit is contained in:
Thomas Bernard 2019-02-11 16:08:55 +01:00
parent 08e955de40
commit 3e32ea04c8
1 changed files with 4 additions and 6 deletions

View File

@ -584,8 +584,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
pUnicast = pCurrAddresses->FirstUnicastAddress; pUnicast = pCurrAddresses->FirstUnicastAddress;
if (pUnicast != NULL) { if (pUnicast != NULL) {
for (i = 0; pUnicast != NULL; i++) { for (i = 0; pUnicast != NULL; i++) {
IPAddr.S_un.S_addr = (u_long) pUnicast->Address; printf("\tIP Address[%d]: \t%s\n", i, inet_ntoa(((PSOCKADDR_IN)pUnicast->Address.lpSockaddr)->sin_addr) );
printf("\tIP Address[%d]: \t%s\n", i, inet_ntoa(IPAddr) );
pUnicast = pUnicast->Next; pUnicast = pUnicast->Next;
} }
printf("\tNumber of Unicast Addresses: %d\n", i); printf("\tNumber of Unicast Addresses: %d\n", i);
@ -593,8 +592,7 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
pAnycast = pCurrAddresses->FirstAnycastAddress; pAnycast = pCurrAddresses->FirstAnycastAddress;
if (pAnycast) { if (pAnycast) {
for (i = 0; pAnycast != NULL; i++) { for (i = 0; pAnycast != NULL; i++) {
IPAddr.S_un.S_addr = (u_long) pAnyCast->Address; printf("\tAnycast Address[%d]: \t%s\n", i, inet_ntoa(((PSOCKADDR_IN)pAnycast->Address.lpSockaddr)->sin_addr) );
printf("\tAnycast Address[%d]: \t%s\n", i, inet_ntoa(IPAddr) );
pAnycast = pAnycast->Next; pAnycast = pAnycast->Next;
} }
printf("\tNumber of Anycast Addresses: %d\n", i); printf("\tNumber of Anycast Addresses: %d\n", i);
@ -602,8 +600,8 @@ ssdpDiscoverDevices(const char * const deviceTypes[],
pMulticast = pCurrAddresses->FirstMulticastAddress; pMulticast = pCurrAddresses->FirstMulticastAddress;
if (pMulticast) { if (pMulticast) {
for (i = 0; pMulticast != NULL; i++) { for (i = 0; pMulticast != NULL; i++) {
IPAddr.S_un.S_addr = (u_long) pMultiCast->Address; printf("\tMulticast Address[%d]: \t%s\n", i, inet_ntoa(((PSOCKADDR_IN)pMulticast->Address.lpSockaddr)->sin_addr) );
printf("\tMulticast Address[%d]: \t%s\n", i, inet_ntoa(IPAddr) ); pMulticast = pMulticast->Next;
} }
} }
printf("\n"); printf("\n");