Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VBinDiff - Visual Binary Diff
=============================

[Visual Binary Diff (VBinDiff)](http://www.cjmweb.net/vbindiff/) displays files in hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and highlight the differences between them. Unlike diff, it works well with large files (up to 4 GB).
[Visual Binary Diff (VBinDiff)](http://www.cjmweb.net/vbindiff/) displays files in hexadecimal and ASCII (or EBCDIC). It can also display two files at once, and highlight the differences between them. Unlike diff, it works well with large files (up to 64 GB).

VBinDiff was inspired by the Compare Files function of the [ProSel utilities by Glen Bredon](http://www.apple2.org.za/gswv/USA2WUG/Glen.Bredon.In.Memoriam/A2.Software/), for the [Apple II](https://en.wikipedia.org/wiki/Apple_II). When I couldn't find a similar utility for the PC, I wrote it myself.

Expand Down
2 changes: 1 addition & 1 deletion tools/ReadMe.tt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $stash->set(section => sub {
Visual Binary Diff (VBinDiff) displays files in hexadecimal and ASCII
(or EBCDIC). It can also display two files at once, and highlight the
differences between them. Unlike diff, it works well with large files
(up to 4 GB).
(up to 64 GB).

VBinDiff was inspired by the Compare Files function of the ProSel
utilities by Glen Bredon, for the Apple II. When I couldn't find a
Expand Down
2 changes: 1 addition & 1 deletion tools/vbindiff.pod.tt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ B<vbindiff> I<file1> [ I<file2> ]
Visual Binary Diff (VBinDiff) displays files in hexadecimal and ASCII
(or EBCDIC). It can also display two files at once, and highlight
the differences between them. Unlike B<diff>, it works well with
large files (up to 4 GB).
large files (up to 64 GB).

=head2 Viewing files

Expand Down
14 changes: 7 additions & 7 deletions vbindiff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ const Command cmUseBottom = 11;
const Command cmToggleASCII = 12;
const Command cmFind = 16; // Commands 16-19

const short leftMar = 11; // Starting column of hex display
const short leftMar2 = 61; // Starting column of ASCII display
const short leftMar = 13; // Starting column of hex display
const short leftMar2 = 63; // Starting column of ASCII display

const int lineWidth = 16; // Number of bytes displayed per line

Expand Down Expand Up @@ -460,7 +460,7 @@ void FileDisplay::display()
FPos lineOffset = offset;

short i,j,index,lineLength;
char buf[lineWidth + lineWidth/8 + 1];
char buf[lineWidth + lineWidth/8];
buf[sizeof(buf)-1] = '\0';

char buf2[screenWidth+1];
Expand All @@ -472,7 +472,7 @@ void FileDisplay::display()
// cerr << i << '\n';
char* str = buf2;
str +=
sprintf(str, "%04X %04X:",Word(lineOffset>>16),Word(lineOffset&0xFFFF));
sprintf(str, "%01X %04X %04X:",Word(lineOffset>>32),Word(lineOffset>>16),Word(lineOffset&0xFFFF));

lineLength = min(lineWidth, bufContents - i*lineWidth);

Expand Down Expand Up @@ -1548,17 +1548,17 @@ Command getCommand()

void gotoPosition(Command cmd)
{
positionInWin(cmd, inWidth+2, " Goto ");
positionInWin(cmd, inWidth+3, " Goto ");

const int maxLen = inWidth-2;
const int maxLen = inWidth-1;
char buf[maxLen+1];

getString(buf, maxLen, positionHistory, hexDigits, true);

if (!buf[0])
return;

FPos pos = strtoul(buf, NULL, 16);
FPos pos = _strtoui64(buf, NULL, 16);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realised that this may not be portable...


if (cmd & cmgGotoTop)
file1.moveTo(pos);
Expand Down