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

Diff for /src/usr.bin/systat/main.c between version 1.62 and 1.63

version 1.62, 2015/03/12 01:03:00 version 1.63, 2015/04/18 18:28:38
Line 296 
Line 296 
 void  void
 cmd_count(const char *buf)  cmd_count(const char *buf)
 {  {
           const char *errstr;
         int ms;          int ms;
         ms = atoi(buf);  
   
         if (ms <= 0 || ms > lines - HEADER_LINES)          maxprint = strtonum(buf, 1, lines - HEADER_LINES, &errstr);
           if (errstr)
                 maxprint = lines - HEADER_LINES;                  maxprint = lines - HEADER_LINES;
         else  
                 maxprint = ms;  
 }  }
   
   
Line 380 
Line 379 
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         char errbuf[_POSIX2_LINE_MAX];          char errbuf[_POSIX2_LINE_MAX];
           const char *errstr;
         extern char *optarg;          extern char *optarg;
         extern int optind;          extern int optind;
         double delay = 5;          double delay = 5;
Line 418 
Line 418 
                         interactive = 0;                          interactive = 0;
                         break;                          break;
                 case 'd':                  case 'd':
                         countmax = atoi(optarg);                          countmax = strtonum(optarg, 1, INT_MAX, &errstr);
                         if (countmax < 0)                          if (errstr)
                                 countmax = 0;                                  errx(1, "-d %s: %s", optarg, errstr);
                         break;                          break;
                 case 'i':                  case 'i':
                         interactive = 1;                          interactive = 1;
Line 438 
Line 438 
                                 delay = 5;                                  delay = 5;
                         break;                          break;
                 case 'w':                  case 'w':
                         rawwidth = atoi(optarg);                          rawwidth = strtonum(optarg, 1, MAX_LINE_BUF-1, &errstr);
                         if (rawwidth < 1)                          if (errstr)
                                 rawwidth = DEFAULT_WIDTH;                                  errx(1, "-w %s: %s", optarg, errstr);
                         if (rawwidth >= MAX_LINE_BUF)  
                                 rawwidth = MAX_LINE_BUF - 1;  
                         break;                          break;
                 default:                  default:
                         usage();                          usage();

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63