idSMTPServer.pas fix

Giganews Newsgroups
Subject: idSMTPServer.pas fix
Posted by:  Catalin Petrisor (catalinpetris…@gmail.com)
Date: Sat, 28 May 2005

in CommandData procedure ReplaceNew array is not initialized. I believe the
code should look like this:

procedure TIdSMTPServer.CommandDATA(ASender: TIdCommand);
{...}
begin
        {...}
        // Parse the ReceivedString and replace any of the special 'tokens'
        SetLength(ReplaceOld,7);
        SetLength(ReplaceNew,7);

        ReplaceOld[0] :=  '$hostname';  {do not localize}
        {...}
end;

instead of

procedure TIdSMTPServer.CommandDATA(ASender: TIdCommand);
{...}
begin
        {...}
        // Parse the ReceivedString and replace any of the special 'tokens'
        SetLength(ReplaceOld,7);

        ReplaceOld[0] :=  '$hostname';  {do not localize}
        {...}
end;

Thank you.
Catalin

Replies