Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!ucla-cs!trainor From: trainor@ucla-cs.UUCP Newsgroups: net.sources Subject: Re: A Usenet article generator [4.3 FIX] Message-ID: <4544@curly.ucla-cs.UCLA.EDU> Date: Thu, 19-Feb-87 03:36:43 EST Article-I.D.: curly.4544 Posted: Thu Feb 19 03:36:43 1987 Date-Received: Fri, 20-Feb-87 01:54:10 EST References: <906@epimass.UUCP> <4521@curly.ucla-cs.UCLA.EDU> Sender: root@ucla-cs.UCLA.EDU Reply-To: trainor@CS.UCLA.EDU (Vulture of Light) Organization: UCLA Computer Science Department Lines: 26 >Well, I compiled and run it, but at the end of producing its amusing >output, it constantly gives "Segmentation fault - core dumped". This >is on a VAX running 4.3BSD. Same here. It's just a sloppy pointer thing... The DIFFs follow. Also, the roll(n) function was returning large integers, outside the range. Please note that the low-order bits of most rand() functions are junk!!!! If you have random(), use it. Douglas 141c141 < srand ((unsigned) atoi (optarg)); --- > srand (atoi (optarg)); 377c377 < return (int) (n * (double) rand() / 32768.); --- > return ((((rand()>>8)&0x7fff)*n)/0x7fff); 403c403 < if (tp == NULL) --- > if (p->scnod == (struct node *) NULL || tp == (char *) NULL) ARPA: trainor@locus.ucla.edu UUCP: ..!{sch-loki,silogic,randvax,ihnp4,sdcrdcf,trwspp,ucbvax}!ucla-cs!trainor SNAKE: trainor@eric.sidewinder.snake