diff options
author | Han Han <hhan@redhat.com> | 2022-06-20 16:45:19 +0800 |
---|---|---|
committer | Han Han <hhan@redhat.com> | 2022-06-20 16:45:19 +0800 |
commit | 96d775860fb7e404d6acaf7e8dfbd171cfbcee15 (patch) | |
tree | 7199ba68409175271c949e340616bccdc8482d78 | |
parent | 4bf4819a0dfddc53810a640e3be83dbbeeab0802 (diff) | |
download | usbutils-96d775860fb7e404d6acaf7e8dfbd171cfbcee15.tar.gz |
Fix an runtime error reported by undefind sanitizer
Fix the following error when compiling with undefined sanitizer:
./lsusb
names.c:36:29: runtime error: left shift of 16 by 27 places cannot be represented in type 'int'
Signed-off-by: Han Han <hhan@redhat.com>
-rw-r--r-- | names.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -33,7 +33,7 @@ static unsigned int hashnum(unsigned int num) { - unsigned int mask1 = HASH1 << 27, mask2 = HASH2 << 27; + unsigned int mask1 = (unsigned int)HASH1 << 27, mask2 = (unsigned int)HASH2 << 27; for (; mask1 >= HASH1; mask1 >>= 1, mask2 >>= 1) if (num & mask1) |