From f659668a80ab6554801dd8c8a5ed0fd8a3f24db4 Mon Sep 17 00:00:00 2001 From: Andrew Davison Date: Mon, 20 Jan 2025 08:14:25 +1000 Subject: [PATCH] Float format long values, re issue #658 --- src/bif_format.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/bif_format.c b/src/bif_format.c index ec1ce622..97201cbd 100644 --- a/src/bif_format.c +++ b/src/bif_format.c @@ -420,7 +420,8 @@ bool do_format(query *q, cell *str, pl_idx str_ctx, cell *p1, pl_idx p1_ctx, cel return throw_error(q, c, q->st.curr_frame, "type_error", "float"); } - len = argval || argval_specified ? argval : 40; + len = argval; + if (len <= 40) len = 40; CHECK_BUF(len); if (argval || argval_specified) { @@ -444,7 +445,8 @@ bool do_format(query *q, cell *str, pl_idx str_ctx, cell *p1, pl_idx p1_ctx, cel return throw_error(q, c, q->st.curr_frame, "type_error", "float"); } - len = argval || argval_specified ? argval : 40; + len = argval; + if (len <= 40) len = 40; CHECK_BUF(len); if (argval || argval_specified) { @@ -467,7 +469,8 @@ bool do_format(query *q, cell *str, pl_idx str_ctx, cell *p1, pl_idx p1_ctx, cel return throw_error(q, c, q->st.curr_frame, "type_error", "float"); } - len = argval || argval_specified ? argval : 40; + len = argval; + if (len <= 40) len = 40; CHECK_BUF(len); if (argval || argval_specified)