Subject: Re: Bug in cmp(1)
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu, rsk@ecs.soton.ac.uk>
From: Charles Hannum <mycroft>
List: netbsd-bugs
Date: 03/25/1994 09:08:55
I just fixed this.  Try the following patch.

===================================================================
RCS file: /b/source/CVS/src/usr.bin/cmp/cmp.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -c -2 -r1.5 -r1.6
*** 1.5	1993/12/02 01:56:04
--- 1.6	1994/03/25 17:07:02
***************
*** 40,44 ****
  #ifndef lint
  /*static char sccsid[] = "from: @(#)cmp.c	5.3 (Berkeley) 6/1/90";*/
! static char rcsid[] = "$Id: cmp.c,v 1.5 1993/12/02 01:56:04 mycroft Exp $";
  #endif /* not lint */
  
--- 40,44 ----
  #ifndef lint
  /*static char sccsid[] = "from: @(#)cmp.c	5.3 (Berkeley) 6/1/90";*/
! static char rcsid[] = "$Id: cmp.c,v 1.6 1994/03/25 17:07:02 mycroft Exp $";
  #endif /* not lint */
  
***************
*** 159,163 ****
  		len2 -= len;
  		if (len1)
! 			buf1 += cnt;
  		else
  			switch (len1 = read(fd1, buf1 = buffer1, MAXBSIZE)) {
--- 159,163 ----
  		len2 -= len;
  		if (len1)
! 			buf1 += len;
  		else
  			switch (len1 = read(fd1, buf1 = buffer1, MAXBSIZE)) {
***************
*** 184,188 ****
  			}
  		if (len2)
! 			buf2 += cnt;
  		else
  			switch (len2 = read(fd2, buf2 = buffer2, MAXBSIZE)) {
--- 184,188 ----
  			}
  		if (len2)
! 			buf2 += len;
  		else
  			switch (len2 = read(fd2, buf2 = buffer2, MAXBSIZE)) {

------------------------------------------------------------------------------