Correct an error in a manpage example, add -Wall -W to Makefile (no
warnings given) and modify source to use arc4random() instead of random(). Reviewed by: ache
This commit is contained in:
parent
2c7723a7c9
commit
4b9cb490c3
@ -2,4 +2,6 @@
|
||||
|
||||
PROG= jot
|
||||
|
||||
CFLAGS += -Wall -W
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -169,9 +169,9 @@ the result of
|
||||
.Dl jot -w %ds/old/new/ 30 2 - 5
|
||||
.Pp
|
||||
The stuttering sequence 9, 9, 8, 8, 7, etc. can be
|
||||
produced by suitable choice of precision and step size,
|
||||
produced by suitable choice of step size,
|
||||
as in
|
||||
.Dl jot 0 9 - -.5
|
||||
.Dl jot - 9 0 -.5
|
||||
.Pp
|
||||
and a file containing exactly 1024 bytes is created with
|
||||
.Dl jot -b x 512 > block
|
||||
|
@ -42,7 +42,7 @@ static const char copyright[] =
|
||||
static char sccsid[] = "@(#)jot.c 8.1 (Berkeley) 6/6/93";
|
||||
#endif
|
||||
static const char rcsid[] =
|
||||
"$Id: jot.c,v 1.7 1997/07/15 09:59:30 charnier Exp $";
|
||||
"$Id: jot.c,v 1.8 1997/11/03 07:45:33 charnier Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
@ -101,12 +101,8 @@ main(argc, argv)
|
||||
getargs(argc, argv);
|
||||
if (randomize) {
|
||||
*x = (ender - begin) * (ender > begin ? 1 : -1);
|
||||
if (s == -1.0)
|
||||
srandomdev();
|
||||
else
|
||||
srandom((unsigned long) s);
|
||||
for (*i = 1; *i <= reps || infinity; (*i)++) {
|
||||
*y = (double) random() / LONG_MAX;
|
||||
*y = (double) arc4random() / ULONG_MAX;
|
||||
putdata(*y * *x + begin, reps - *i);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user