Rob Shearman : avifil32: Pass the number of characters to LoadStringW, not the number of bytes.
Alexandre Julliard
julliard at winehq.org
Fri Feb 15 05:35:48 CST 2008
Module: wine
Branch: master
Commit: 89a2eab3f439e5ddf98d27fac5931ce799ab8b60
URL: http://source.winehq.org/git/wine.git/?a=commit;h=89a2eab3f439e5ddf98d27fac5931ce799ab8b60
Author: Rob Shearman <rob at codeweavers.com>
Date: Wed Feb 13 16:21:53 2008 +0000
avifil32: Pass the number of characters to LoadStringW, not the number of bytes.
---
dlls/avifil32/avifile.c | 8 ++++----
dlls/avifil32/wavfile.c | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/avifil32/avifile.c b/dlls/avifil32/avifile.c
index 5becaf4..b0ef1cb 100644
--- a/dlls/avifil32/avifile.c
+++ b/dlls/avifil32/avifile.c
@@ -1656,7 +1656,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
This->fInfo.dwWidth = MainAVIHdr.dwWidth;
This->fInfo.dwHeight = MainAVIHdr.dwHeight;
LoadStringW(AVIFILE_hModule, IDS_AVIFILETYPE, This->fInfo.szFileType,
- sizeof(This->fInfo.szFileType));
+ sizeof(This->fInfo.szFileType)/sizeof(This->fInfo.szFileType[0]));
/* go back to into header list */
if (mmioAscend(This->hmmio, &ck, 0) != S_OK)
@@ -1767,9 +1767,9 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
/* generate description for stream like "filename.avi Type #n" */
if (streamHdr.fccType == streamtypeVIDEO)
- LoadStringW(AVIFILE_hModule, IDS_VIDEO, szType, sizeof(szType));
+ LoadStringW(AVIFILE_hModule, IDS_VIDEO, szType, sizeof(szType)/sizeof(szType[0]));
else if (streamHdr.fccType == streamtypeAUDIO)
- LoadStringW(AVIFILE_hModule, IDS_AUDIO, szType, sizeof(szType));
+ LoadStringW(AVIFILE_hModule, IDS_AUDIO, szType, sizeof(szType)/sizeof(szType[0]));
else
wsprintfW(szType, streamTypeFmt, (char*)&streamHdr.fccType);
@@ -1782,7 +1782,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
memset(pStream->sInfo.szName, 0, sizeof(pStream->sInfo.szName));
- LoadStringW(AVIFILE_hModule, IDS_AVISTREAMFORMAT, streamNameFmt, sizeof(streamNameFmt));
+ LoadStringW(AVIFILE_hModule, IDS_AVISTREAMFORMAT, streamNameFmt, sizeof(streamNameFmt)/sizeof(streamNameFmt[0]));
/* FIXME: avoid overflow -- better use wsnprintfW, which doesn't exists ! */
wsprintfW(pStream->sInfo.szName, streamNameFmt,
diff --git a/dlls/avifil32/wavfile.c b/dlls/avifil32/wavfile.c
index 7791a66..b9779e3 100644
--- a/dlls/avifil32/wavfile.c
+++ b/dlls/avifil32/wavfile.c
@@ -607,9 +607,9 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
memset(& This->sInfo, 0, sizeof(This->sInfo));
LoadStringW(AVIFILE_hModule, IDS_WAVEFILETYPE, This->fInfo.szFileType,
- sizeof(This->fInfo.szFileType));
+ sizeof(This->fInfo.szFileType)/sizeof(This->fInfo.szFileType[0]));
if (LoadStringW(AVIFILE_hModule, IDS_WAVESTREAMFORMAT,
- wszStreamFmt, sizeof(wszStreamFmt)) > 0) {
+ wszStreamFmt, sizeof(wszStreamFmt)/sizeof(wszStreamFmt[0])) > 0) {
wsprintfW(This->sInfo.szName, wszStreamFmt,
AVIFILE_BasenameW(This->szFileName));
}
More information about the wine-cvs
mailing list