itss: Use FIELD_OFFSET to calculate the size of a struct with variable length array.

oldstable
Michael Stefaniuc 2012-11-02 15:17:06 +01:00 committed by Alexandre Julliard
parent fb724cfd7b
commit 815031d832
1 changed files with 1 additions and 1 deletions

View File

@ -354,7 +354,7 @@ static HRESULT ITS_IMoniker_create( IMoniker **ppObj, LPCWSTR name, DWORD n )
DWORD sz;
/* szFile[1] has space for one character already */
sz = sizeof(ITS_IMonikerImpl) + strlenW( name )*sizeof(WCHAR);
sz = FIELD_OFFSET( ITS_IMonikerImpl, szFile[strlenW( name ) + 1] );
itsmon = HeapAlloc( GetProcessHeap(), 0, sz );
itsmon->IMoniker_iface.lpVtbl = &ITS_IMonikerImpl_Vtbl;