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

Fix ArrayIndexOutOfBoundsException in formatSize() on huge sizes #44

Merged
merged 1 commit into from
May 1, 2024

Conversation

tom93
Copy link
Contributor

@tom93 tom93 commented Mar 25, 2024

Previously it would crash on sizes greater than ~1.2e15 (1024 TB). By adding two more units, it will work on all possible Long values.

What is it?

  • Bugfix
  • Feature
  • Codebase improvement

Description of the changes in your PR

Fixes the following issue(s)

Not tracked

Acknowledgement

Previously it would crash on sizes greater than ~1.2e15 (1024 TB). By
adding two more units, it will work on all possible Long values.

Also make Int.formatSize() a simple wrapper for Long.formatSize() to
avoid code repetition.

And add attribution, because the code appears to have been copied from
https://stackoverflow.com/posts/5599842/revisions#rev-body-85411f2d-9228-4768-9a7f-04c6d392a385
@naveensingh naveensingh merged commit 36482cd into FossifyOrg:master May 1, 2024
1 check passed
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.

2 participants