[BACK]Return to rusers.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / rusers

Diff for /src/usr.bin/rusers/rusers.c between version 1.36 and 1.37

version 1.36, 2015/12/09 19:39:10 version 1.37, 2016/03/17 05:27:10
Line 141 
Line 141 
         if (hflag + iflag + uflag > 1)          if (hflag + iflag + uflag > 1)
                 usage();                  usage();
   
         if (isatty(STDOUT_FILENO)) {          termwidth = 0;
                 if ((cp = getenv("COLUMNS")) != NULL && *cp != '\0') {          if ((cp = getenv("COLUMNS")) != NULL)
                         termwidth = strtol(cp, &ep, 10);                  termwidth = strtonum(cp, 1, LONG_MAX, NULL);
                         if (*ep != '\0' || termwidth >= INT_MAX ||          if (termwidth == 0 && ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&
                             termwidth < 0)              win.ws_col > 0)
                                 termwidth = 0;                  termwidth = win.ws_col;
                 }          if (termwidth == 0)
                 if (termwidth == 0 &&  
                     ioctl(STDOUT_FILENO, TIOCGWINSZ, &win) == 0 &&  
                     win.ws_col > 0)  
                         termwidth = win.ws_col;  
                 else  
                         termwidth = 80;  
         } else  
                 termwidth = 80;                  termwidth = 80;
   
         setvbuf(stdout, NULL, _IOLBF, 0);          setvbuf(stdout, NULL, _IOLBF, 0);
   
         if (argc == optind) {          if (argc == optind) {

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37