Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-09-15 12:11:29 +0400
committerEric Andersen <andersen@codepoet.org>2003-09-15 12:11:29 +0400
commit2205c84de4c8cc75e3446936f7d93e32391f4aed (patch)
treec616073152862564cf2181b6c7c2619de7b470cf /init
parent1393a39df491307314679fbc7026eaba60a9efb2 (diff)
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.
Diffstat (limited to 'init')
-rw-r--r--init/init.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/init/init.c b/init/init.c
index 8da358cb5..85792c9b7 100644
--- a/init/init.c
+++ b/init/init.c
@@ -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);