DD_STRUCT_COPY_BYSIZE: Do not clear more that struct size.

This commit is contained in:
Christian Costa 2004-03-16 01:13:29 +00:00 committed by Alexandre Julliard
parent 69cf835ce0
commit 85cbe8213b
1 changed files with 4 additions and 1 deletions

View File

@ -45,7 +45,10 @@
do { \ do { \
DWORD __size = (to)->dwSize; \ DWORD __size = (to)->dwSize; \
DWORD __copysize = __size; \ DWORD __copysize = __size; \
memset(to,0,__size); \ DWORD __resetsize = __size; \
if (__resetsize > sizeof(*to)) \
__resetsize = sizeof(*to); \
memset(to,0,__resetsize); \
if ((from)->dwSize < __size) \ if ((from)->dwSize < __size) \
__copysize = (from)->dwSize; \ __copysize = (from)->dwSize; \
memcpy(to,from,__copysize); \ memcpy(to,from,__copysize); \