On Tue, 2012-10-30 at 09:50 +0100, Christian Costa wrote:
> Just by curiosity. What the difference with strncmpW?
strncmp tests the first string for null termination. You should really
determine that by yourself though :-)
> >> Do you have a concrete example that does not work with this implementation
> > How about CompareStringOrdinal( "a\0a", 3, "a\0b", 3 )?
> >
> >
> There is a similar test in the patch:
>
> WCHAR test1[] = { 't','e','s','t',0 };
> WCHAR test3[] = { 't','e','s','t','3',0 };
>
> ret = pCompareStringOrdinal(test1, 5, test3, 5, TRUE);
> ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret, CSTR_LESS_THAN);
It's not the same test. The nulls are not at the same index and you're not
asking CompareStringOrdinal to read past a null.