fix hex dump function

This commit is contained in:
Kelvin Sherlock 2014-04-26 20:35:03 -04:00
parent ebab9328f6
commit ee1c7a9440
1 changed files with 13 additions and 5 deletions

View File

@ -491,11 +491,12 @@ return FALSE;
BOOLEAN NextSeg(void) BOOLEAN NextSeg(void)
{ {
if ((format == 2)
|| ((format == 1) && !header && !checkf)) { if ( (format == 2 || format == 1) && !header && !checkf) {
numsex = 0; numsex = 0;
return TRUE; return TRUE;
} }
do do
{ {
if ((ftype == LIBFL) || (version == 2)) { if ((ftype == LIBFL) || (version == 2)) {
@ -1233,7 +1234,7 @@ while (NextSeg()) {
if (body) { /* write out the body */ if (body) { /* write out the body */
if ((! header) && checkf) { if ((! header) && checkf) {
count = bod_disp; count = bod_disp;
fseek(input, ftell(input) + bod_disp, SEEK_CUR); fseek(input, ftell(input) + bod_disp, SEEK_SET);
} }
PutOpCodeBody(); PutOpCodeBody();
} }
@ -2361,6 +2362,8 @@ while (NextSeg()) {
} }
if ((! shorth) || body) if ((! shorth) || body)
puts("\n"); puts("\n");
if (!checkf && !header) break;
} }
} }
@ -2383,8 +2386,10 @@ int k, i, space;
while (NextSeg()) { while (NextSeg()) {
count = 0L; count = 0L;
CheckESC(); CheckESC();
if (! PutHeader()) /* write out the header */ if (checkf || header) /* write out the header */
return; if (! PutHeader())
return;
/* if we don't print header and we're not doing file checking then /* if we don't print header and we're not doing file checking then
dump the entire file and forget about segment scanning */ dump the entire file and forget about segment scanning */
if ((! checkf) && (! header)) { /* get the segment length */ if ((! checkf) && (! header)) { /* get the segment length */
@ -2400,6 +2405,7 @@ while (NextSeg()) {
count = bod_disp; count = bod_disp;
fseek(input, ftell(input) + bod_disp, SEEK_SET); fseek(input, ftell(input) + bod_disp, SEEK_SET);
} }
while (count <= mark) { while (count <= mark) {
putchar('\n'); putchar('\n');
if (colf) if (colf)
@ -2431,6 +2437,8 @@ while (NextSeg()) {
} }
} }
if ((! shorth) || body) printf("\n\n"); if ((! shorth) || body) printf("\n\n");
if (!checkf && !header) break;
} }
} }