diff options
author | Greg Kaiser <gkaiser@google.com> | 2019-12-17 05:43:47 -0800 |
---|---|---|
committer | Greg Kaiser <gkaiser@google.com> | 2019-12-17 05:43:47 -0800 |
commit | 669932f3ff6d168317788c130bc39634ee5ba0c0 (patch) | |
tree | c8e6465622db7323359251886a3f97bded63e1c0 /partition_tools | |
parent | 35692b040079b188c487314f5489e55476518f25 (diff) | |
download | extras-669932f3ff6d168317788c130bc39634ee5ba0c0.tar.gz |
lpdump: Use unsigned value for shift
Shifting a signed 32-bit value by 31 bits is implementation-defined
behavior. While our toolchains are most probably doing the
expected thing, we make this an unsigned value out of paranoia.
Test: TreeHugger
Change-Id: I551fcf1ac7a27ebd7c1365cd6a9df7267f569c44
Diffstat (limited to 'partition_tools')
-rw-r--r-- | partition_tools/lpdump.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/partition_tools/lpdump.cc b/partition_tools/lpdump.cc index af370483..c6be2e7d 100644 --- a/partition_tools/lpdump.cc +++ b/partition_tools/lpdump.cc @@ -72,7 +72,7 @@ static std::string BuildHeaderFlagString(uint32_t flags) { std::vector<std::string> strings; for (uint32_t i = 0; i < sizeof(flags) * 8; i++) { - if (!(flags & (1 << i))) { + if (!(flags & (1U << i))) { continue; } strings.emplace_back("unknown_flag_bit_" + std::to_string(i)); |