We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3afe76f commit 5e9b7b1Copy full SHA for 5e9b7b1
include/boost/histogram/detail/term_info.hpp
@@ -69,9 +69,9 @@ inline bool utf8() {
69
inline int width() {
70
int w = 0;
71
#if defined TIOCGWINSZ
72
- struct winsize ws;
73
- ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
74
- w = (std::max)(static_cast<int>(ws.ws_col), 0); // not sure if ws_col can be less than 0
+ struct winsize ws{};
+ if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0)
+ w = (std::max)(static_cast<int>(ws.ws_col), 0); // not sure if ws_col can be less than 0
75
#endif
76
env_t env("COLUMNS");
77
const int col = (std::max)(static_cast<int>(env), 0);
0 commit comments