hexyl
hexyl copied to clipboard
memory allocation of 4340410370284600376 bytes failed
Hello,
A typo lead to a bug discovery:
hexyl --terminal-width 2 1.txt
memory allocation of 4340410370284600376 bytes failed
It seems any terminal width less than 10 leads to a memory allocation issue.
Thank you for reporting this
How large is the 1.txt file?
This should work: wc -c 1.txt
I think this has to do with the (terminal_width - offset) calculation (taking a quick peek at main).
You can reproduce it with
▶ hexyl --terminal-width 2 <(echo "test")
memory allocation of 4340410370284600376 bytes failed
Looks very much just like an underflow in that subtraction, yes.