Path: utzoo!attcan!uunet!ncrlnk!ncr-sd!hp-sdd!hplabs!nsc!taux01!taux02!amos From: amos@taux02.UUCP (Amos Shapir) Newsgroups: comp.sources.bugs Subject: Re: v05i039: Random Name Generator Source Code Message-ID: <267@taux02.UUCP> Date: 14 Nov 88 07:40:24 GMT References: <3f6d7ec2.805@hi-csc.UUCP> Organization: National Semiconductor (IC) Ltd, Israel Home of the 32532 Lines: 55 Hdate: 5 Kislev 5749 There was a bug in the macro definition of rnd(); also toupper does not have a '_' prepended on BSD systems (not on Sequent's dynix, anyway). o / o / o / o / --Cut-here-------X---------------X---------------X---------------X---- o \ o \ o \ o \ *** name.c.orig Mon Nov 14 09:32:45 1988 --- name.c Mon Nov 14 09:19:03 1988 *************** *** 13,18 #define srandom srand48 #define random lrand48 #else #include #endif --- 13,19 ----- #define srandom srand48 #define random lrand48 #else + #define _toupper(c) toupper(c) #include #endif *************** *** 23,29 #define MAXNAME 30 #define MINLENGTH 3 #define RANGE 6 ! #define rnd(n) ((unsigned) random() % (unsigned) n) /* Since "y" and "'" appear twice, once in each array, all other letters are doubled to keep the distribution even. */ --- 24,30 ----- #define MAXNAME 30 #define MINLENGTH 3 #define RANGE 6 ! #define rnd(n) ((unsigned) random() % (unsigned) (n)) /* Since "y" and "'" appear twice, once in each array, all other letters are doubled to keep the distribution even. */ o / o / o / o / --Cut-here-------X---------------X---------------X---------------X---- o \ o \ o \ o \ May the Source be with you, always... -- Amos Shapir amos@nsc.com National Semiconductor (Israel) P.O.B. 3007, Herzlia 46104, Israel Tel. +972 52 522261 TWX: 33691, fax: +972-52-558322 34 48 E / 32 10 N (My other cpu is a NS32532)