Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/boost/histogram/detail/term_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ inline bool utf8() {
inline int width() {
int w = 0;
#if defined TIOCGWINSZ
struct winsize ws;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
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
#endif
env_t env("COLUMNS");
const int col = (std::max)(static_cast<int>(env), 0);
Expand Down