Skip to content

Commit

Permalink
Prevent static code analyzer confusion
Browse files Browse the repository at this point in the history
As reported in bug #48723:
http://savannah.nongnu.org/bugs/?48723

This is a false positive and the static code analyzer output should
be made clearer. Nevertheless we can write the code differently so
that it doesn't trigger a warning.
  • Loading branch information
jdelvare committed Sep 7, 2016
1 parent 5696fa3 commit 0b5c47c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dmidecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2283,7 +2283,7 @@ static void dmi_memory_device_extended_size(u32 code)
*/
if (code & 0x3FFUL)
printf(" %lu MB", (unsigned long)code);
else if (code & 0xFFFFFUL)
else if (code & 0xFFC00UL)
printf(" %lu GB", (unsigned long)code >> 10);
else
printf(" %lu TB", (unsigned long)code >> 20);
Expand Down

0 comments on commit 0b5c47c

Please sign in to comment.