Browse Source

Fix VarEnsureRange use of Result before being set

git-svn-id: trunk@20771 -
pierre 13 years ago
parent
commit
f052ced5c3
1 changed files with 2 additions and 2 deletions
  1. 2 2
      rtl/inc/variants.pp

+ 2 - 2
rtl/inc/variants.pp

@@ -3054,9 +3054,9 @@ end;
 
 
 function VarEnsureRange(const AValue, AMin, AMax: Variant): Variant;
 function VarEnsureRange(const AValue, AMin, AMax: Variant): Variant;
 begin
 begin
-  If Result>AMAx then
+  If AValue>AMAx then
     Result:=AMax
     Result:=AMax
-  else If Result<AMin Then
+  else If AValue<AMin Then
     Result:=AMin
     Result:=AMin
   else
   else
     Result:=AValue;
     Result:=AValue;