[dlls/dmusic/collection.c] Strncpy elimination.
Peter Berg Larsen
pebl at math.ku.dk
Sun Mar 27 12:43:52 CST 2005
How is the length of pwszName returned to the caller? Should it be
\0 terminated?
Changelog:
Replace an strncpy with an memcpy as the length is found
above.
Index: dlls/dmusic/collection.c
===================================================================
RCS file: /home/wine/wine/dlls/dmusic/collection.c,v
retrieving revision 1.12
diff -u -r1.12 collection.c
--- dlls/dmusic/collection.c 26 Jan 2005 19:41:43 -0000 1.12
+++ dlls/dmusic/collection.c 26 Mar 2005 09:40:24 -0000
@@ -139,7 +139,7 @@
ICOM_NAME_MULTI (IDirectMusicInstrumentImpl, InstrumentVtbl, tmpEntry->pInstrument, pInstrument);
IDirectMusicInstrument_GetPatch (tmpEntry->pInstrument, pdwPatch);
dwNameLen = strlenW (pInstrument->wszName);
- strncpyW (pwszName, pInstrument->wszName, dwNameLen);
+ memcpy (pwszName, pInstrument->wszName, dwNameLen * sizeof(WCHAR));
return S_OK;
}
r++;
More information about the wine-patches
mailing list