Comply with Range checking

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@478 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2008-06-09 14:52:30 +00:00
parent 5cac370447
commit 645525652c

View File

@ -595,14 +595,17 @@ var
begin
AResAttValue := '';
If Assigned(ANode) And Assigned(ANode.Attributes) Then Begin
c := Pred(ANode.Attributes.Length);
For i := 0 To c Do Begin
If AnsiSameText(AAttName,ANode.Attributes.Item[i].NodeName) Then Begin
AResAttValue := ANode.Attributes.Item[i].NodeValue;
Result := True;
Exit;
c := ANode.Attributes.Length;
if ( c > 0 ) then begin
Dec(c);
For i := 0 To c Do Begin
If AnsiSameText(AAttName,ANode.Attributes.Item[i].NodeName) Then Begin
AResAttValue := ANode.Attributes.Item[i].NodeValue;
Result := True;
Exit;
End;
End;
End;
end;
End;
Result := False;
end;