Browse Source

* Fixed AnsiCompareStr and AnsiCompareText if string(s) contains #0. It fixes webtbs/tw3170.pp

git-svn-id: trunk@5949 -
yury 18 years ago
parent
commit
fef99bf8cb
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/wince/sysutils.pp

+ 2 - 2
rtl/wince/sysutils.pp

@@ -853,7 +853,7 @@ var
 begin
 begin
   ws1:=StringToPWideChar(S1);
   ws1:=StringToPWideChar(S1);
   ws2:=StringToPWideChar(S2);
   ws2:=StringToPWideChar(S2);
-  Result:=CompareString(LOCALE_USER_DEFAULT, 0, ws1, -1, ws2, -1) - 2;
+  Result:=CompareString(LOCALE_USER_DEFAULT, 0, ws1, Length(S1), ws2, Length(S2)) - 2;
   FreeMem(ws2);
   FreeMem(ws2);
   FreeMem(ws1);
   FreeMem(ws1);
 end;
 end;
@@ -865,7 +865,7 @@ var
 begin
 begin
   ws1:=StringToPWideChar(S1);
   ws1:=StringToPWideChar(S1);
   ws2:=StringToPWideChar(S2);
   ws2:=StringToPWideChar(S2);
-  Result:=CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, ws1, -1, ws2, -1) - 2;
+  Result:=CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, ws1, Length(S1), ws2, Length(S2)) - 2;
   FreeMem(ws2);
   FreeMem(ws2);
   FreeMem(ws1);
   FreeMem(ws1);
 end;
 end;