Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of zcash#1615 - arithmetric:1612.fix-floating-point-except…
…ion, r=daira Fixing floating point exception in non-TTY environments As reported in zcash#1612, a floating point exception occurs when zcashd is started with `showmetrics` enabled in environments without a TTY, such as when started as a service or piped to a file. The root cause is that the metrics code attempts to get the screen width and uses this as a divisor in calculations. For non-TTY environments, this value is 0, leading to a division by zero error. This PR adds a default screen width of 80 and uses the actual screen width only if the width can be fetched (and in a TTY environment).
- Loading branch information