Calculates 16 bit values incorrectly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ghex (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: ghex
Expected GHex to calculate the 16 bit unsigned value to 512 when selecting 0x0002 (little endian).
I have found that it matters if I select the higher byte first or the lower byte first. It seems that GHex calculates the number of selected bytes and then reads the bytes from where the pointer is at the moment. I have attached a screen shot that depicts the miscalculation.
elprogrammet@
Description: Ubuntu 9.10
Release: 9.10
elprogrammet@
ghex:
Installed: 2.24.0-1
Candidate: 2.24.0-1
Version table:
*** 2.24.0-1 0
500 http://
100 /var/lib/
ghex calculates the multi-byte values not on the selection, but on the cursor and the following bytes... so for a 16-bit value, you should just select the first byte of the pair. In your screenshot, you have offset 0xC selected, so it will use the bytes in offsets 0xC and 0xD to calculate the 16-bit number, which is 0x0202, or 514, as it shows. If you move the cursor to offset 0xB, it would show 512 as expected.