Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ames!uhccux!munnari.oz.au!csc!gih900 From: gih900@csc.anu.oz (Geoff Huston) Newsgroups: news.software.anu-news Subject: Re: RE: Comments on V5.9C Message-ID: <1346.25bc1ec9@csc.anu.oz> Date: 23 Jan 90 09:07:21 GMT References: <9001191517.AA14344@uunet.UU.NET> Organization: Computer Services, Australian National University Lines: 57 In article <9001191517.AA14344@uunet.UU.NET>, munnari!anu.anu.oz.au!gih900@CSC.DNET (Geoff Huston) writes: > Here's my solution:... > > NNTP_SERVER.C > > /* file names - change this line */ > #define NEWSBATCH "NEWS_MANAGER:NNTP_%s_%X.BATCH" > > /* new procedure */ > > static char timestr[14]; > > static > char *time_str() > { > int ctime; > struct tm *stm; > > time(&ctime); > stm = localtime(&ctime); > sprintf(timestr,"%02d%02d%02d%02d%02d%02d", > stm->tm_year,stm->tm_mon,stm->tm_mday,stm->tm_hour,stm->tm_min,stm->tm_sec); > return(timestr); > } > /* ...... */ > > /* char batch[] was previously declared as a local var to add_item */ > > static char batch[FILE_STRLEN] = ""; > > static > add_item(fn,mode,msgbuf,stm) > char *fn; > int mode; > char *msgbuf; > int stm; > { > FILE *fpr, > *fpw; > char line[BUFF_STRLEN], > batch[FILE_STRLEN]; the above two lines are WRONG!! that should be: char line[BUFF_STRLEN]; i.e. batch is NOT a local variable! sorry bout that - cheers, Geoff