From 30a7d0a5a73cca607f2ed77497fd8acaef74688e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 7 Nov 2011 11:44:35 +0100 Subject: [PATCH] shell32/tests: Avoid some array bounds warnings. --- dlls/shell32/tests/shlfolder.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index c61a9723904..bee6cb5a13a 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -1806,6 +1806,7 @@ static void test_ITEMIDLIST_format(void) { cbOffset <= pidlFile->mkid.cb - sizeof(struct FileStructW)) { struct FileStructW *pFileStructW = (struct FileStructW *)(((LPBYTE)pidlFile)+cbOffset); + WCHAR *name = pFileStructW->wszName; ok(pidlFile->mkid.cb == cbOffset + pFileStructW->cbLen, "FileStructW's offset and length should add up to the PIDL's length!\n"); @@ -1842,9 +1843,9 @@ static void test_ITEMIDLIST_format(void) { /* TODO: Perform check for date being within one day.*/ } - ok (!lstrcmpW(wszFile[i], pFileStructW->wszName) || - !lstrcmpW(wszFile[i], (WCHAR *)(pFileStructW->abFooBar2 + 22)) || /* Vista */ - !lstrcmpW(wszFile[i], (WCHAR *)(pFileStructW->abFooBar2 + 26)), /* Win7 */ + ok (!lstrcmpW(wszFile[i], name) || + !lstrcmpW(wszFile[i], name + 9) || /* Vista */ + !lstrcmpW(wszFile[i], name + 11), /* Win7 */ "The filename should be stored in unicode at this position!\n"); } } -- 2.11.4.GIT