mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
CPU (Linux): prevents variables from integer overflow
This commit is contained in:
@@ -862,9 +862,9 @@ FF_MAYBE_UNUSED static uint16_t getLoongarchPropCount(FFstrbuf* cpuinfo, const c
|
||||
char* pend;
|
||||
unsigned long id = strtoul(p, &pend, 10);
|
||||
if (__builtin_expect(id > 64, false))
|
||||
high |= 1 << (id - 64);
|
||||
high |= 1UL << (id - 64);
|
||||
else
|
||||
low |= 1 << id;
|
||||
low |= 1UL << id;
|
||||
p = pend;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user