Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed PosExStringPas/PosExPas with negative Offsets (should return 0)
  • Loading branch information
Arnaud Bouchez committed Dec 2, 2019
1 parent 0e01b30 commit 9fce260
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions SynCommons.pas
Expand Up @@ -22773,7 +22773,7 @@ function PosExStringPas(pSub, p: PChar; Offset: PtrUInt): PtrInt;
AfterTestT, AfterTest0, Ret, Exit; AfterTestT, AfterTest0, Ret, Exit;
begin begin
result := 0; result := 0;
if (p=nil) or (pSub=nil) or (Offset<1) then if (p=nil) or (pSub=nil) or (PtrInt(Offset)<=0) then
goto Exit; goto Exit;
{$ifdef FPC} {$ifdef FPC}
len := _LStrLenP(p); len := _LStrLenP(p);
Expand Down Expand Up @@ -24193,7 +24193,7 @@ function PosExPas(pSub, p: PUTF8Char; Offset: PtrUInt): PtrInt;
AfterTestT, AfterTest0, Ret, Exit; AfterTestT, AfterTest0, Ret, Exit;
begin begin
result := 0; result := 0;
if (p=nil) or (pSub=nil) or (Offset<1) then if (p=nil) or (pSub=nil) or (PtrInt(Offset)<=0) then
goto Exit; goto Exit;
{$ifdef FPC} {$ifdef FPC}
len := _LStrLenP(p); len := _LStrLenP(p);
Expand Down
2 changes: 1 addition & 1 deletion SynopseCommit.inc
@@ -1 +1 @@
'1.18.5485' '1.18.5486'

0 comments on commit 9fce260

Please sign in to comment.