From: Philippe E. <ph...@wa...> - 2003-04-15 18:36:41
|
Sebastian wrote: > Hi, > > unsigned int > be_random (unsigned int max) > { > unsigned int tmp; > > > if (rand_fd == -1) > be_randinit (); > > read (rand_fd, &tmp, sizeof (tmp)); > > /* 0 denotes special 0 to 2^32 - 1 range > */ > if (max == 0) > return (tmp); > > return (tmp % max); > } > In any case, there is no way for be_random to return without defining %eax. if read fails tmp is not initialized regards, Philippe Elie |