rem: Screen_cols = columns; Screen_rows = lines; if (-1 != (ioctl(STDOUT_FILENO, TIOCGWINSZ, &wz))) {
add: Screen_cols = columns; Screen_rows = lines;  if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &wz) != -1 && wz.ws_col>0 && wz.ws_row>0) {
context: static void wins_resize (int dont_care_sig){   struct winsize wz;   (void)dont_care_sig;   Screen_cols = columns;   Screen_rows = lines;   if (-1 != (ioctl(STDOUT_FILENO, TIOCGWINSZ, &wz))) {      Screen_cols = wz.ws_col;      Screen_rows = wz.ws_row;   }   if (Batch) Screen_rows = MAXINT;   // we might disappoint some folks (but they'll deserve it)   if (SCREENMAX < Screen_cols) Screen_cols = SCREENMAX;   /* keep our support for output optimization in sync with current reality      note: when we're in Batch mode, we don't really need a Pseudo_scrn and            when not Batch, our buffer will contain 1 extra 'line' since            Msg_row is never represented -- but it's nice to have some space            between us and the great-beyond... */   Pseudo_cols = Screen_cols + CLRBUFSIZ + 1;   if (Batch) Pseudo_size = ROWBUFSIZ + 1;      else Pseudo_size = Pseudo_cols * Screen_rows;   Pseudo_scrn = alloc_r(Pseudo_scrn, Pseudo_size);   // force rebuild of column headers AND libproc/readproc requirements   Frames_libflags = 0;   ZAP_TIMEOUT}