[fpc-devel]Bug in AnsiStrComp

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Sep 13 14:14:54 CEST 2002


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





More information about the fpc-devel mailing list