bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

drand48() in cfenvd


From: Elizabeth Cassell
Subject: drand48() in cfenvd
Date: Tue, 24 Aug 2004 13:34:15 -0700 (PDT)

I've been playing with the latest snapshot of cfenvd, and noticed this:
in cfenvd.c, in function RejectAnomaly:

   srand((unsigned int)time(NULL));

   if (drand48() < 0.7) /* 70% chance of using full value - as in learning
policy */
      {
      return new;
      }
   else
      {
      return average+2.0*dev;
      }


drand48() is always returning 0, because it wants to be initalized
with srand48(), not srand().




reply via email to

[Prev in Thread] Current Thread [Next in Thread]