bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] Incorrect output from cmp


From: Tucker Berckmann
Subject: [bug-diffutils] Incorrect output from cmp
Date: Wed, 3 Oct 2012 23:37:51 +0000
User-agent: Microsoft-MacOutlook/14.2.4.120824

Hello,

I am getting some strange output from cmp on two files. The index is off by one for the first and last difference, and both the index and values are wrong for the second difference. I tried two versions of cmp (listed below), and I got the same output in both cases. My system info is also displayed below.

Regards,

Tucker Berckmann | Firmware Engineer | SanDisk | t. +1.408.801.2940 | address@hidden | www.SanDisk.com

$ cmp -l file1 file2
 10   2   4
 64  16  13
200   4   2

$ cmp -l file1 file2 | awk '{printf("%x %x %x\n",$1,$2,$3)}'
a 2 4
40 10 d
c8 4 2

$ hexdump file1
0000000 0c 00 00 00 00 00 00 00 01 02 00 07 0a 00 0b 0a
0000010 1f 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000020 00 00 00 00 00 00 00 00 00 10 00 00 00 08 00 00
0000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0e
0000040 00 10 08 08 04 03 20 04 40 00 40 00 00 00 14 00
0000050 02 01 00 03 05 08 00 00 00 00 ff ff ff ff 01 03
0000060 02 07 ff ff ff ff 01 00 00 00 00 03 02 00 ff ff
0000070 ff ff 01 00 00 00 00 03 02 00 ff ff ff ff 01 00
0000080 00 00 00 03 02 00 ff ff ff ff 01 00 00 00 00 03
0000090 02 00 ff ff ff ff 01 00 00 00 00 03 02 00 ff ff
00000a0 ff ff 01 00 00 00 00 03 02 00 00 00 00 00 00 00
00000b0 00 00 00 00 00 00 01 00 1e 00 00 00 04 00 00 00
00000c0 03 07 00 00 00 00 00 04 00 00 00 00 00 00 00 00
00000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000200

$ hexdump file2
0000000 0c 00 00 00 00 00 00 00 01 04 00 07 0a 00 0b 0a
0000010 1f 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0000020 00 00 00 00 00 00 00 00 00 10 00 00 00 08 00 00
0000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0b
0000040 00 10 08 08 04 03 20 04 40 00 40 00 00 00 14 00
0000050 02 01 00 03 05 08 00 00 00 00 ff ff ff ff 01 03
0000060 02 07 ff ff ff ff 01 00 00 00 00 03 02 00 ff ff
0000070 ff ff 01 00 00 00 00 03 02 00 ff ff ff ff 01 00
0000080 00 00 00 03 02 00 ff ff ff ff 01 00 00 00 00 03
0000090 02 00 ff ff ff ff 01 00 00 00 00 03 02 00 ff ff
00000a0 ff ff 01 00 00 00 00 03 02 00 00 00 00 00 00 00
00000b0 00 00 00 00 00 00 01 00 1e 00 00 00 04 00 00 00
00000c0 03 07 00 00 00 00 00 02 00 00 00 00 00 00 00 00
00000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
*
0000200

$ cmp --version
cmp (GNU diffutils) 2.8.1
Copyright (C) 2002 Free Software Foundation, Inc.

This program comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of this program
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.

Written by Torbjorn Granlund and David MacKenzie.

$ /opt/local/libexec/gnubin/cmp --version
cmp (GNU diffutils) 3.2
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Torbjörn Granlund and David MacKenzie.

$ uname -a
Darwin <hostname> 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386




PLEASE NOTE: The information contained in this electronic mail message is intended only for the use of the designated recipient(s) named above. If the reader of this message is not the intended recipient, you are hereby notified that you have received this message in error and that any review, dissemination, distribution, or copying of this message is strictly prohibited. If you have received this communication in error, please notify the sender by telephone or e-mail (as shown above) immediately and destroy any and all copies of this message in your possession (whether hard copies or electronically stored copies).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]