Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2002-09

Bug in AnsiStrComp

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi devels,

I found a small bug in the functions AnsiStrComp, AnsiStrIComp, AnsiStrLComp and AnsiStrLIComp. For example AnsiStrComp(nil,'fpc') crashes with an AV.

All 4 funcs start with:

  If S1=Nil then
    begin
    If S2=Nil Then Exit;
    result:=-1;
    end;
Just add behind the 'result:=-1;' an 'exit;' to fix this:
  If S1=Nil then
    begin
      If S2=Nil Then Exit;
      result:=-1;
      exit;
    end;

Mattias Gaertner

Reply by email