msxml3/tests: VT_EMPTY is not a string (resend 2)

Dan Kegel dank at
Sun Jun 22 16:32:31 CDT 2008

This time using NULL instead of (void *) 0.

Casting a VT_EMPTY to a string gets you a null string.
The test was doing that and taking the string length, then comparing to zero.
Better to simply compare to null; that's a stronger test, and
avoids generating a behind-the-scenes exception.

kernel32/tests is the place to test that lstrlenW( badptr ) == 0,
no need to duplicate that here.

Passes on Wine and XP, and gets rid of the valgrind warning
 Invalid read of size 2
   at  strlenW (unicode.h:212)
   by  lstrlenW (string.c:384)
   by  test_xmlelem (xmlelem.c:83)
   by  func_xmlelem (xmlelem.c:455)
 Address 0x0 is not stack'd, malloc'd or (recently) free'd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: msxml3-xmlelem.patch
Type: text/x-diff
Size: 1022 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list