projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1393a39
)
comparison was always false due to limited range of data types.
author
Eric Andersen
<andersen@codepoet.org>
Mon, 15 Sep 2003 08:11:29 +0000
(08:11 -0000)
committer
Eric Andersen
<andersen@codepoet.org>
Mon, 15 Sep 2003 08:11:29 +0000
(08:11 -0000)
Carefully cast to unsigned long long prior to multiply to get
the expected result.
init/init.c
patch
|
blob
|
history
diff --git
a/init/init.c
b/init/init.c
index 8da358cb51b9e0468965272d1f0ae5caf3235e0f..85792c9b7f1fe1a4263a7d2c3793e7428a42d838 100644
(file)
--- 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);