Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend size of address when file is larger than 4GB #72

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

farindk
Copy link
Contributor

@farindk farindk commented Jul 29, 2024

When the file size exceeds 4GB, the current 8 digits are not enough for the address and the display overflows.
This patch fixes #68.

Copy link
Collaborator

@prigaux prigaux left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this fix!
Could you change the few things I commented?

file.c Outdated
@@ -53,6 +53,18 @@ void openFile(void)
fileSize = 0;
}
biggestLoc = fileSize;

// compute number of digits for address
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest adding a comment somewhere explaining that nAddrDigits max is 16 (max size is 2**64 and a hex char is 2**4 wide)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you move this code to a function compute_nAddrDigits (or something alike)

display.c Outdated
@@ -162,6 +162,13 @@ void exitCurses(void)
endwin();
}

static void printaddr(uint64_t addr)
{
char templ[7];
Copy link
Collaborator

Choose a reason for hiding this comment

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

7 needs to be explained.
Afaik it is sizeof("%016lX") with 16 being the max nAddrDigits

@prigaux prigaux merged commit bc5c65b into pixel:master Jul 31, 2024
1 check passed
@farindk farindk deleted the long-addr branch July 31, 2024 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Long file support
2 participants