Mailing List Archive

cl_rndnum()
Hi,

after finding another leaking FILE*, can anybody who knows the code tell
me why /dev/urandom is not closed after the rndnum is generated? After
first look I suspect that the writer thought that /dev/urandom always
returns the same "random" data after being opened, but quick tests and
googling I found nothing that proves this assumption...

Thomas
Re: cl_rndnum() [ In reply to ]
> Hi,
>
> after finding another leaking FILE*, can anybody who knows the code tell
> me why /dev/urandom is not closed after the rndnum is generated? After

This is not a mistake - there's a static FILE* handler for that (for performance
reasons).

> first look I suspect that the writer thought that /dev/urandom always
> returns the same "random" data after being opened, but quick tests and
> googling I found nothing that proves this assumption...

This assumption is false ;))

Best regards,
Tomasz Kojm
--
oo ..... zolw@konarski.edu.pl
(\/)\......... http://www.konarski.edu.pl/~zolw
\..........._ I nie zapomnij kliknac w brzuszek...
//\ /\\ <- C. Amboinensis www.pajacyk.pl