Alexandre Julliard : shell32/tests: Avoid some array bounds warnings.
Alexandre Julliard
julliard at winehq.org
Mon Nov 7 13:30:41 CST 2011
Module: wine
Branch: master
Commit: 30a7d0a5a73cca607f2ed77497fd8acaef74688e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=30a7d0a5a73cca607f2ed77497fd8acaef74688e
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Nov 7 11:44:35 2011 +0100
shell32/tests: Avoid some array bounds warnings.
---
dlls/shell32/tests/shlfolder.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index c61a972..bee6cb5 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");
}
}
More information about the wine-cvs
mailing list