diff options
Diffstat (limited to 'eval_error.c')
-rw-r--r-- | eval_error.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/eval_error.c b/eval_error.c index 82ada4dc40..8aab7ba05d 100644 --- a/eval_error.c +++ b/eval_error.c @@ -195,7 +195,7 @@ print_backtrace(const VALUE eclass, const VALUE errat, const VALUE str, int reve long len = RARRAY_LEN(errat); int skip = eclass == rb_eSysStackError; const int threshold = 1000000000; - int width = ((int)log10((double)(len > threshold ? + int width = (len <= 1) ? INT_MIN : ((int)log10((double)(len > threshold ? ((len - 1) / threshold) : len - 1)) + (len < threshold ? 0 : 9) + 1); |