[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: Re: [PATCH] kernel32: Implement CompareStringOrdinal. (try 2)
From: Christian Costa <titan.costa () gmail ! com>
Date: 2012-10-30 10:06:36
Message-ID: CAMo6X8Z-hHrR=jhOu8sT6BOh=Y5n0fqQGt+TeEFDKi0xOr=gMA () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
2012/10/30 Hans Leidekker <hans@codeweavers.com>
> 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.
>
>
> I just wanted to compare 0 with 3 but you're right, I'll add such a test.
[Attachment #5 (text/html)]
<br><br><div class="gmail_quote">2012/10/30 Hans Leidekker <span dir="ltr"><<a \
href="mailto:hans@codeweavers.com" \
target="_blank">hans@codeweavers.com</a>></span><br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"> <div class="im">On Tue, 2012-10-30 at 09:50 +0100, Christian \
Costa wrote:<br> > Just by curiosity. What the difference with strncmpW?<br>
<br>
</div>strncmp tests the first string for null termination. You should really<br>
determine that by yourself though :-)<br>
<div class="im"><br>
> >> Do you have a concrete example that does not work with this \
implementation<br> > > How about CompareStringOrdinal( "a\0a", 3, \
"a\0b", 3 )?<br> > ><br>
> ><br>
> There is a similar test in the patch:<br>
><br>
> WCHAR test1[] = { 't','e','s','t',0 };<br>
> WCHAR test3[] = { \
't','e','s','t','3',0 };<br> ><br>
> ret = pCompareStringOrdinal(test1, 5, test3, 5, TRUE);<br>
> ok(ret == CSTR_LESS_THAN, "Got %u, expected %u\n", ret, \
CSTR_LESS_THAN);<br> <br>
</div>It's not the same test. The nulls are not at the same index and you're \
not<br> asking CompareStringOrdinal to read past a null.<br>
<br>
<br>
</blockquote></div>I just wanted to compare 0 with 3 but you're right, I'll \
add such a test.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic