Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site umcp-cs.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!chris
From: chris@umcp-cs.UUCP (Chris Torek)
Newsgroups: net.sources.bugs
Subject: Potential bug in floop.c
Message-ID: <816@umcp-cs.UUCP>
Date: Thu, 11-Jul-85 20:26:44 EDT
Article-I.D.: umcp-cs.816
Posted: Thu Jul 11 20:26:44 1985
Date-Received: Sat, 13-Jul-85 12:06:54 EDT
Distribution: net
Organization: U of Maryland, Computer Science Dept., College Park, MD
Lines: 34

While I'm thinking about it, there's some int==long assumptions
in floop.c, where it declares

	long time();

and then proceeds to

	srand (time ((long *) 0));

This should be changed to

	srand ((int) time ((long *) 0));

(It will work on any stack machine that pushes and pops the arguments
to functions in the caller rather than the callee... which is most if
not all Unix machines.  Nevertheless it is kind of sloppy.)

In addition,

	long rand();

is missing (is rand() really a function returning long?) so that the
code that takes rand()>>16 will always give 0 on 16-bitters.  (The
shift is only because rand is so un-random in the low order bits,
as you can visually demonstrate by taking it out....)

If you have a better random number generator than srand/rand, you might
want to use it instead.

(Why do I always think of the last bug while driving home?)
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 4251)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris@umcp-cs		ARPA:	chris@maryland