diff options
| -rw-r--r-- | src/output.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/output.c b/src/output.c index 254d73f..396f3ef 100644 --- a/src/output.c +++ b/src/output.c @@ -34,7 +34,13 @@ void out_print_time_by_option(struct list_node *ptr); inline int fputc_all_cols(char c, FILE *fdout) { struct winsize terminal; ioctl(STDOUT_FILENO, TIOCGWINSZ, &terminal); - return fputc_width_x(c, ((terminal.ws_col == 0) ? 72 : terminal.ws_col), fdout); + /* Somehow not always ws_col == 0, instead > 300 characters */ + if (terminal.ws_col == 0) { + terminal.ws_col = 72; + } else if (terminal.ws_col > 144) { + terminal.ws_col = 144; + } + return fputc_width_x(c, terminal.ws_col, fdout); } |
