Andrew Talbot : dmband: Assign to struct instead of using memcpy.

Alexandre Julliard julliard at winehq.org
Mon Feb 25 06:51:38 CST 2008


Module: wine
Branch: master
Commit: ea85c5b15b7c2eedcae389613f2b03f34fc803bf
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ea85c5b15b7c2eedcae389613f2b03f34fc803bf

Author: Andrew Talbot <andrew.talbot at talbotville.com>
Date:   Sat Feb 23 08:40:25 2008 +0000

dmband: Assign to struct instead of using memcpy.

---

 dlls/dmband/bandtrack.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/dlls/dmband/bandtrack.c b/dlls/dmband/bandtrack.c
index f85d096..b328b1d 100644
--- a/dlls/dmband/bandtrack.c
+++ b/dlls/dmband/bandtrack.c
@@ -302,7 +302,7 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_LoadBand (LPPERSISTSTREAM if
       ERR(": no more memory\n");
       return  E_OUTOFMEMORY;
     }
-    memcpy(&pNewBand->BandHeader, pHeader, sizeof(DMUS_PRIVATE_BAND_ITEM_HEADER));
+    pNewBand->BandHeader = *pHeader;
     pNewBand->pBand = (IDirectMusicBandImpl*)((char*)(*ppBand) - offsetof(IDirectMusicBandImpl,BandVtbl));
     IDirectMusicBand_AddRef(*ppBand);
     list_add_tail (&This->Bands, &pNewBand->entry);
@@ -322,6 +322,8 @@ static HRESULT IDirectMusicBandTrack_IPersistStream_ParseBandsList (LPPERSISTSTR
   IDirectMusicBand* pBand = NULL;
   DMUS_PRIVATE_BAND_ITEM_HEADER header;
 
+  memset(&header, 0, sizeof header);
+
   if (pChunk->fccID != DMUS_FOURCC_BANDS_LIST) {
     ERR_(dmfile)(": %s chunk should be a BANDS list\n", debugstr_fourcc (pChunk->fccID));
     return E_FAIL;




More information about the wine-cvs mailing list