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 begin
AResAttValue := ''; AResAttValue := '';
If Assigned(ANode) And Assigned(ANode.Attributes) Then Begin If Assigned(ANode) And Assigned(ANode.Attributes) Then Begin
c := Pred(ANode.Attributes.Length); c := ANode.Attributes.Length;
For i := 0 To c Do Begin if ( c > 0 ) then begin
If AnsiSameText(AAttName,ANode.Attributes.Item[i].NodeName) Then Begin Dec(c);
AResAttValue := ANode.Attributes.Item[i].NodeValue; For i := 0 To c Do Begin
Result := True; If AnsiSameText(AAttName,ANode.Attributes.Item[i].NodeName) Then Begin
Exit; AResAttValue := ANode.Attributes.Item[i].NodeValue;
Result := True;
Exit;
End;
End; End;
End; end;
End; End;
Result := False; Result := False;
end; end;