diff options
author | Lukas Larsson <[email protected]> | 2013-02-13 14:18:36 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2013-02-13 14:18:36 +0100 |
commit | e55aff9434072dc9ba45b610d2e5110b0d537692 (patch) | |
tree | 621ad19e00799bd3e7bc7501f715918d3743fedc /erts/emulator/beam/bif.c | |
parent | cd08400f92ec7672025bf39a458effcf33a423dc (diff) | |
parent | 4326a0b5030c46a679de0c39dba547783f1dc0e9 (diff) | |
download | otp-e55aff9434072dc9ba45b610d2e5110b0d537692.tar.gz otp-e55aff9434072dc9ba45b610d2e5110b0d537692.tar.bz2 otp-e55aff9434072dc9ba45b610d2e5110b0d537692.zip |
Merge branch 'saleyn/float_to_list_2/OTP-10837'
* saleyn/float_to_list_2/OTP-10837:
Fix memory leak in error case
Use macros instead of constants
float_to_list/2 changed rounding and cosmetic cleanup
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r-- | erts/emulator/beam/bif.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c index 46f76624a5..df084e1185 100644 --- a/erts/emulator/beam/bif.c +++ b/erts/emulator/beam/bif.c @@ -2963,15 +2963,14 @@ BIF_RETTYPE float_to_list_2(BIF_ALIST_2) Eterm* tp = tuple_val(arg); if (*tp == arity_two && is_small(tp[2])) { decimals = signed_val(tp[2]); - if (decimals > 0 && decimals < sizeof(fbuf) - 6 /* "X." ++ "e+YY" */) - switch (tp[1]) { - case am_decimals: - fmt_type = FMT_FIXED; - continue; - case am_scientific: - fmt_type = FMT_SCIENTIFIC; - continue; - } + switch (tp[1]) { + case am_decimals: + fmt_type = FMT_FIXED; + continue; + case am_scientific: + fmt_type = FMT_SCIENTIFIC; + continue; + } } } goto badarg; |