mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-31 12:54:13 +00:00
user.exe16: Use FIELD_OFFSET to calculate the size of a struct with variable length array.
This commit is contained in:
parent
47d2f3caf5
commit
96e428cc9e
1 changed files with 2 additions and 1 deletions
|
@ -1320,7 +1320,8 @@ BOOL16 WINAPI GrayString16( HDC16 hdc, HBRUSH16 hbr, GRAYSTRINGPROC16 gsprc,
|
||||||
struct gray_string_info *info;
|
struct gray_string_info *info;
|
||||||
|
|
||||||
if (!cch) cch = strlen(str16);
|
if (!cch) cch = strlen(str16);
|
||||||
if (!(info = HeapAlloc( GetProcessHeap(), 0, sizeof(*info) + cch ))) return FALSE;
|
info = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( struct gray_string_info, str[cch] ));
|
||||||
|
if (!info) return FALSE;
|
||||||
info->proc = gsprc;
|
info->proc = gsprc;
|
||||||
info->param = lParam;
|
info->param = lParam;
|
||||||
memcpy( info->str, str16, cch );
|
memcpy( info->str, str16, cch );
|
||||||
|
|
Loading…
Reference in a new issue