Commit 86aeb91bd8791aab279e3105fde6b07044f0f632

Francois Perrad 2019-10-20T16:42:37

explicit operand for addition

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/mp_radix_size.c b/mp_radix_size.c
index 387e0ec..e9cfb9b 100644
--- a/mp_radix_size.c
+++ b/mp_radix_size.c
@@ -29,7 +29,7 @@ mp_err mp_radix_size(const mp_int *a, int radix, int *size)
    *size = (int)b;
 
    /* mp_ilogb truncates to zero, hence we need one extra put on top and one for `\0`. */
-   *size += 2 + (a->sign == MP_NEG);
+   *size += 2 + ((a->sign == MP_NEG) ? 1 : 0);
 
 LBL_ERR:
    return err;