mellowcandle / bitwise

Terminal based bit manipulator in ncurses
GNU General Public License v3.0
640 stars 28 forks source link

wrong output on overflow #26

Closed kilobyte closed 5 years ago

kilobyte commented 5 years ago

In the interactive mode, if the input value doesn't fit in chosen word length, instead of returning an error or truncating, bitwise displays a bogus value.

For example, on the first try, I did not notice the 32-bit limitation and typed in 4294967296. I'd expect one of:

yet I got:

hex 19999999
oct 3146314631
bin 0 0 0 1 1 0 0 1 | 1 0 0 1 1 0 0 1 | 1 0 0 1 1 0 0 1 | 1 0 0 1 1 0 0 1
mellowcandle commented 5 years ago

thanks. I'll try to recreate. on which version are you running?

kilobyte commented 5 years ago

v0.32, exact tag (without four later commits, which seem irrelevant). Debian amd64.