Commit 0b69c27c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

iphlpapi: Simplify the calculation of "ptr" in CreateSortedAddressPairs().

parent 06e68ff6
......@@ -387,7 +387,7 @@ DWORD WINAPI CreateSortedAddressPairs( const PSOCKADDR_IN6 src_list, DWORD src_c
size = dst_count * sizeof(*pairs);
size += dst_count * sizeof(SOCKADDR_IN6) * 2; /* source address + destination address */
if (!(pairs = HeapAlloc( GetProcessHeap(), 0, size ))) return ERROR_NOT_ENOUGH_MEMORY;
ptr = (SOCKADDR_IN6 *)(char *)pairs + dst_count * sizeof(*pairs);
ptr = (SOCKADDR_IN6 *)&pairs[dst_count];
if ((ret = getIPAddrTable( &table, GetProcessHeap(), 0 )))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment