mirror of
https://github.com/topjohnwu/ndk-busybox.git
synced 2024-11-25 04:39:48 +00:00
comparison was always false due to limited range of data types.
Carefully cast to unsigned long long prior to multiply to get the expected result.
This commit is contained in:
parent
1393a39df4
commit
2205c84de4
@ -333,7 +333,7 @@ static unsigned int check_free_memory(void)
|
||||
s--;
|
||||
}
|
||||
result = (info.totalram >> s) + (info.totalswap >> s);
|
||||
if ((unsigned long long) (result * u) > UINT_MAX) {
|
||||
if (((unsigned long long)result * (unsigned long long)u) > UINT_MAX) {
|
||||
return(UINT_MAX);
|
||||
} else {
|
||||
return(result * u);
|
||||
|
Loading…
Reference in New Issue
Block a user