From 8b343fd55b25f52070fab36f32c19d64d2641b8e Mon Sep 17 00:00:00 2001 From: Michael Stefaniuc Date: Tue, 19 Feb 2019 20:44:31 +0100 Subject: [PATCH] secur32: Use offsetof() instead of pointer substraction. Signed-off-by: Michael Stefaniuc Signed-off-by: Alexandre Julliard --- dlls/secur32/secur32.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/secur32/secur32.c b/dlls/secur32/secur32.c index b3ab80a850b..8288286c615 100644 --- a/dlls/secur32/secur32.c +++ b/dlls/secur32/secur32.c @@ -247,8 +247,8 @@ static void _makeFnTableA(PSecurityFunctionTableA fnTableA, * implemented (yikes) */ size_t tableSize = inFnTableA->dwVersion == 1 ? - (const BYTE *)&inFnTableA->SetContextAttributesA - - (const BYTE *)inFnTableA : sizeof(SecurityFunctionTableA); + offsetof(SecurityFunctionTableA, SetContextAttributesA) : + sizeof(SecurityFunctionTableA); memcpy(fnTableA, inFnTableA, tableSize); /* override this, since we can do it internally anyway */ @@ -318,8 +318,8 @@ static void _makeFnTableW(PSecurityFunctionTableW fnTableW, * implemented (yikes) */ size_t tableSize = inFnTableW->dwVersion == 1 ? - (const BYTE *)&inFnTableW->SetContextAttributesW - - (const BYTE *)inFnTableW : sizeof(SecurityFunctionTableW); + offsetof(SecurityFunctionTableW, SetContextAttributesW) : + sizeof(SecurityFunctionTableW); memcpy(fnTableW, inFnTableW, tableSize); /* override this, since we can do it internally anyway */