Subject: bin/1435: comm.c premature eof
To: None <gnats-bugs@NetBSD.ORG>
From: None <andreas@planix.com>
List: netbsd-bugs
Date: 09/05/1995 00:27:00
>Number:         1435
>Category:       bin
>Synopsis:       comm does not print the remaingin lines of the longer file
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep  5 10:50:04 1995
>Last-Modified:
>Originator:     Andreas Wrede
>Organization:
Andreas Wrede                  Planix, Inc.
andreas@planix.com             Networking, System Administration, Consulting
http://www.planix.com          Toronto, Ontario, Canada
>Release:        <NetBSD-current source date>Aug 29, 95
>Environment:
	
System: NetBSD woffi 1.0A NetBSD 1.0A (WOFFI) #20: Tue Aug 29 08:09:23 EDT 1995 root@woffi:/local/netbsd-current/src/sys/arch/i386/compile/WOFFI i386


>Description:
	comm does not print all lines of a second input file iff the first file is shorter. 
>How-To-Repeat:
	
    cnews's addmissing -d, which should re-create the history file from the 
    news spool, leaves the history file with only one article.
>Fix:
	
    Apply patch:

*** comm.c.ori	Tue Sep  5 00:18:26 1995
--- comm.c	Tue Sep  5 00:16:29 1995
***************
*** 169,175 ****
  	FILE *fp;
  	char *offset, *buf;
  {
! 	while (printf("%s%s", offset, buf) < 0 && fgets(buf, MAXLINELEN, fp))
  		;
  }
  
--- 169,175 ----
  	FILE *fp;
  	char *offset, *buf;
  {
! 	while (printf("%s%s", offset, buf) > 0 && fgets(buf, MAXLINELEN, fp))
  		;
  }
  
>Audit-Trail:
>Unformatted: