avifil32: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-11-13 20:33:37 +01:00 committed by Alexandre Julliard
parent f92cfb31d2
commit 143ce73c7a
1 changed files with 4 additions and 5 deletions

View File

@ -1119,10 +1119,10 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
HeapFree(GetProcessHeap(), 0, lp);
/* add "All files" "*.*" filter if enough space left */
size = LoadStringW(AVIFILE_hModule, IDS_ALLFILES,
szAllFiles, (sizeof(szAllFiles) - sizeof(all_files))/sizeof(WCHAR)) + 1;
size = LoadStringW(AVIFILE_hModule, IDS_ALLFILES, szAllFiles,
ARRAY_SIZE(szAllFiles) - ARRAY_SIZE(all_files)) + 1;
memcpy( szAllFiles + size, all_files, sizeof(all_files) );
size += sizeof(all_files) / sizeof(WCHAR);
size += ARRAY_SIZE(all_files);
if (cbFilter > size) {
memcpy(szFilter, szAllFiles, size * sizeof(szAllFiles[0]));
@ -2109,8 +2109,7 @@ HRESULT WINAPI EditStreamSetInfoA(PAVISTREAM pstream, LPAVISTREAMINFOA asi,
return AVIERR_BADSIZE;
memcpy(&asiw, asi, sizeof(asiw) - sizeof(asiw.szName));
MultiByteToWideChar(CP_ACP, 0, asi->szName, -1,
asiw.szName, sizeof(asiw.szName)/sizeof(WCHAR));
MultiByteToWideChar(CP_ACP, 0, asi->szName, -1, asiw.szName, ARRAY_SIZE(asiw.szName));
return EditStreamSetInfoW(pstream, &asiw, sizeof(asiw));
}