Commit 713af451 authored by Peter Pentchev's avatar Peter Pentchev

Fix a cppcheck signed shift warning.

parent d8017728
......@@ -4,6 +4,8 @@ Change log for hexer, the multi-view binary editor
- allow hexer to be cross-built: if CC_FOR_BUILD is defined in
the build environment, use it as the command to build bin2c as
submitted by Helmut Grohne <helmut@subdivi.de>.
- fix undefined behavior by shifting an unsigned, not a signed,
value the maximum number of bits to the left.
1.0.3 2016/10/16
- correct a couple of grammatical nits in the README file.
......
......@@ -414,7 +414,7 @@ calc_operation(int position, int binary)
} else
int_f = 0;
x.u.f = pow(x.u.f, y.u.f);
if (int_f && x.u.f < (unsigned)(1 << (LONG_BITS - 1)) - 1) {
if (int_f && x.u.f < (1u << (LONG_BITS - 1)) - 1) {
x.type = CO_INTEGER;
x.u.i = (int)x.u.f;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment