Commit 815031d8 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent fb724cfd
......@@ -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;
......
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