diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-10 15:15:42 +0100 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-12-10 15:15:42 +0100 |
| commit | c665c183f15f4246da3d44fba92883ef05fc98af (patch) | |
| tree | a3b6bfaea9736337a93cd3b45a05d6305b74482a /miscutils | |
| parent | 8b4cf0dbb08a8a526045051b442e45cb2359b224 (diff) | |
| download | busybox-w32-c665c183f15f4246da3d44fba92883ef05fc98af.tar.gz busybox-w32-c665c183f15f4246da3d44fba92883ef05fc98af.tar.bz2 busybox-w32-c665c183f15f4246da3d44fba92883ef05fc98af.zip | |
bc: 0xffffffffffffffff may be larger than unsigned long
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'miscutils')
| -rw-r--r-- | miscutils/bc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c index 71022569e..9774ac45b 100644 --- a/miscutils/bc.c +++ b/miscutils/bc.c | |||
| @@ -1476,9 +1476,9 @@ static void bc_num_ulong2num(BcNum *n, unsigned long val) | |||
| 1476 | 1476 | ||
| 1477 | if (ULONG_MAX == 0xffffffffUL) | 1477 | if (ULONG_MAX == 0xffffffffUL) |
| 1478 | bc_num_expand(n, 10); // 10 digits: 4294967295 | 1478 | bc_num_expand(n, 10); // 10 digits: 4294967295 |
| 1479 | if (ULONG_MAX == 0xffffffffffffffffUL) | 1479 | if (ULONG_MAX == 0xffffffffffffffffULL) |
| 1480 | bc_num_expand(n, 20); // 20 digits: 18446744073709551615 | 1480 | bc_num_expand(n, 20); // 20 digits: 18446744073709551615 |
| 1481 | BUILD_BUG_ON(ULONG_MAX > 0xffffffffffffffffUL); | 1481 | BUILD_BUG_ON(ULONG_MAX > 0xffffffffffffffffULL); |
| 1482 | 1482 | ||
| 1483 | ptr = n->num; | 1483 | ptr = n->num; |
| 1484 | for (;;) { | 1484 | for (;;) { |
