aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--miscutils/bc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/miscutils/bc.c b/miscutils/bc.c
index 866fa3027..b392b05a3 100644
--- a/miscutils/bc.c
+++ b/miscutils/bc.c
@@ -2039,6 +2039,11 @@ static BcStatus bc_num_p(BcNum *a, BcNum *b, BcNum *restrict c, size_t scale)
2039 powrdx <<= 1; 2039 powrdx <<= 1;
2040 s = bc_num_mul(&copy, &copy, &copy, powrdx); 2040 s = bc_num_mul(&copy, &copy, &copy, powrdx);
2041 if (s) goto err; 2041 if (s) goto err;
2042 // It is too slow to handle ^C only after entire "2^1000000" completes
2043 if (G_interrupt) {
2044 s = BC_STATUS_FAILURE;
2045 goto err;
2046 }
2042 } 2047 }
2043 2048
2044 bc_num_copy(c, &copy); 2049 bc_num_copy(c, &copy);
@@ -2054,6 +2059,11 @@ static BcStatus bc_num_p(BcNum *a, BcNum *b, BcNum *restrict c, size_t scale)
2054 s = bc_num_mul(c, &copy, c, resrdx); 2059 s = bc_num_mul(c, &copy, c, resrdx);
2055 if (s) goto err; 2060 if (s) goto err;
2056 } 2061 }
2062 // It is too slow to handle ^C only after entire "2^1000000" completes
2063 if (G_interrupt) {
2064 s = BC_STATUS_FAILURE;
2065 goto err;
2066 }
2057 } 2067 }
2058 2068
2059 if (neg) { 2069 if (neg) {