Henri Verbeet : iphlpapi: Simplify the calculation of "ptr" in CreateSortedAddressPairs().
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Aug 12 09:17:54 CDT 2015
Module: wine
Branch: master
Commit: 0b69c27c4150c02aa6a9bd0da439f506c45291c4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0b69c27c4150c02aa6a9bd0da439f506c45291c4
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Sun Aug 9 13:13:52 2015 +0200
iphlpapi: Simplify the calculation of "ptr" in CreateSortedAddressPairs().
---
dlls/iphlpapi/iphlpapi_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index b6ab612..4b1261a 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -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 )))
{
More information about the wine-cvs
mailing list