* GetRandomBytes calls random only once

git-svn-id: trunk@11123 -
This commit is contained in:
michael 2008-05-29 13:16:07 +00:00
parent 8b94b4b849
commit fb53b5e9f6

View File

@ -569,6 +569,9 @@ begin
Result := DoForceDirectories(SetDirSeparators(Dir));
end;
Var
GUIDCalledRandomize : Boolean = False;
Procedure GetRandomBytes(Var Buf; NBytes : Integer);
Var
@ -577,7 +580,11 @@ Var
begin
P:=@Buf;
Randomize;
If Not GUIDCalledRandomize then
begin
GUIDCalledRandomize:=True;
Randomize;
end;
For I:=0 to NBytes-1 do
P[i]:=Random(256);
end;