A bug in unbnews.c (2.10.1)

scw at cepu.UUCP scw at cepu.UUCP
Thu Oct 4 00:16:17 AEST 1984


There is a problem with the distributed unbnews.c (in 2.10.1)
This problem only affects machines where (sizeof int) != (sizeof long)
The manifestation is that any LONG article (size > 32767) will cause
unbnews to bomb out. I discovered this bug while working on a batched
news spooler (the pipe to unbnews kept vanishing).

*** unbnews.c.B	Tue May  1 10:24:17 1984
--- unbnews.c	Tue Oct  2 21:09:42 1984
***************
*** 42,45
  	char	line[80];
  	long	bytes = 0;
  
  	if( fgets(line, sizeof(line), fp)==NULL )

--- 42,46 -----
  	char	line[80];
  	long	bytes = 0;
+ 	long atol();
  
  	if( fgets(line, sizeof(line), fp)==NULL )
***************
*** 47,51
  
  	if( line[0]=='#' && line[1]=='!' )
! 		sscanf(line, "#! %s %d", command, &bytes);
  	else
  		bytes = atoi(line);

--- 48,52 -----
  
  	if( line[0]=='#' && line[1]=='!' )
! 		sscanf(line, "#! %s %D", command, &bytes);
  	else
  		bytes = atol(line);
***************
*** 49,53
  		sscanf(line, "#! %s %d", command, &bytes);
  	else
! 		bytes = atoi(line);
  
  	return(bytes);

--- 50,54 -----
  		sscanf(line, "#! %s %D", command, &bytes);
  	else
! 		bytes = atol(line);
  
  	return(bytes);
-- 
Stephen C. Woods (VA Wadsworth Med Ctr./UCLA Dept. of Neurology)
uucp:	{ {ihnp4, uiucdcs}!bradley, hao, trwrb, sdcrdcf}!cepu!scw
ARPA: cepu!scw at ucla-cs location: N 34 3' 9.1" W 118 27' 4.3"



More information about the Net.bugs mailing list