Commit dabf9217a18ebf042238bcf401f1b6632b400716

Francois Perrad 2017-10-15T16:27:41

add parentheses for explicit operator precedence

diff --git a/bn_mp_fread.c b/bn_mp_fread.c
index 92fd73f..6922183 100644
--- a/bn_mp_fread.c
+++ b/bn_mp_fread.c
@@ -42,7 +42,7 @@ int mp_fread(mp_int *a, int radix, FILE *stream)
 
       y = (int)mp_s_rmap_reverse[pos];
 
-      if (y == 0xff || y >= radix) {
+      if ((y == 0xff) || (y >= radix)) {
          break;
       }
 
diff --git a/bn_mp_read_radix.c b/bn_mp_read_radix.c
index af1fb33..55c5ee1 100644
--- a/bn_mp_read_radix.c
+++ b/bn_mp_read_radix.c
@@ -60,7 +60,7 @@ int mp_read_radix(mp_int *a, const char *str, int radix)
        * and is less than the given radix add it
        * to the number, otherwise exit the loop.
        */
-      if (y == 0xff || y >= radix) {
+      if ((y == 0xff) || (y >= radix)) {
          break;
       }
       if ((res = mp_mul_d(a, (mp_digit)radix, a)) != MP_OKAY) {
@@ -73,7 +73,7 @@ int mp_read_radix(mp_int *a, const char *str, int radix)
    }
 
    /* if an illegal character was found, fail. */
-   if (!(*str == '\0' || *str == '\r' || *str == '\n')) {
+   if (!((*str == '\0') || (*str == '\r') || (*str == '\n'))) {
       mp_zero(a);
       return MP_VAL;
    }