From ee1c7a944096bd435408580df7e8ed78fdaf28d4 Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 26 Apr 2014 20:35:03 -0400 Subject: [PATCH 1/2] fix hex dump function --- DumpOBJ.cc | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/DumpOBJ.cc b/DumpOBJ.cc index 50c6a87..db5b7f6 100644 --- a/DumpOBJ.cc +++ b/DumpOBJ.cc @@ -491,11 +491,12 @@ return FALSE; BOOLEAN NextSeg(void) { -if ((format == 2) - || ((format == 1) && !header && !checkf)) { + +if ( (format == 2 || format == 1) && !header && !checkf) { numsex = 0; return TRUE; } + do { if ((ftype == LIBFL) || (version == 2)) { @@ -1233,7 +1234,7 @@ while (NextSeg()) { if (body) { /* write out the body */ if ((! header) && checkf) { count = bod_disp; - fseek(input, ftell(input) + bod_disp, SEEK_CUR); + fseek(input, ftell(input) + bod_disp, SEEK_SET); } PutOpCodeBody(); } @@ -2361,6 +2362,8 @@ while (NextSeg()) { } if ((! shorth) || body) puts("\n"); + + if (!checkf && !header) break; } } @@ -2383,8 +2386,10 @@ int k, i, space; while (NextSeg()) { count = 0L; CheckESC(); - if (! PutHeader()) /* write out the header */ - return; + if (checkf || header) /* write out the header */ + if (! PutHeader()) + return; + /* if we don't print header and we're not doing file checking then dump the entire file and forget about segment scanning */ if ((! checkf) && (! header)) { /* get the segment length */ @@ -2400,6 +2405,7 @@ while (NextSeg()) { count = bod_disp; fseek(input, ftell(input) + bod_disp, SEEK_SET); } + while (count <= mark) { putchar('\n'); if (colf) @@ -2431,6 +2437,8 @@ while (NextSeg()) { } } if ((! shorth) || body) printf("\n\n"); + + if (!checkf && !header) break; } } From 7b60740a02ce0c1dc21107ad854194abe535bb6e Mon Sep 17 00:00:00 2001 From: MikeW50 Date: Sun, 25 Mar 2018 15:23:32 -0600 Subject: [PATCH 2/2] Update DumpOBJ.cc --- DumpOBJ.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DumpOBJ.cc b/DumpOBJ.cc index db5b7f6..8d3cb6d 100644 --- a/DumpOBJ.cc +++ b/DumpOBJ.cc @@ -492,7 +492,7 @@ BOOLEAN NextSeg(void) { -if ( (format == 2 || format == 1) && !header && !checkf) { +if ((format == 2 || format == 1) && !header && !checkf) { numsex = 0; return TRUE; }