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

Diff for /src/usr.bin/snmp/snmpc.c between version 1.32 and 1.33

version 1.32, 2021/03/03 09:06:20 version 1.33, 2021/03/23 22:07:36
Line 799 
Line 799 
                 if (clock_gettime(CLOCK_UPTIME, &ts) == -1)                  if (clock_gettime(CLOCK_UPTIME, &ts) == -1)
                         err(1, "clock_gettime");                          err(1, "clock_gettime");
         } else {          } else {
                 lval = strtonum(argv[1], 0, LLONG_MAX, &errstr);                  lval = strtonum(argv[1], 0, UINT32_MAX, &errstr);
                 if (errstr != NULL)                  if (errstr != NULL)
                         errx(1, "Bad value notation (%s)", argv[1]);                          errx(1, "Bad value notation (%s)", argv[1]);
                 ts.tv_sec = lval / 100;                  ts.tv_sec = lval / 100;
Line 1437 
Line 1437 
                          */                           */
                         goto pastestring;                          goto pastestring;
                 case 'c':                  case 'c':
                         lval = strtonum(argv[i + 2], INT32_MIN, INT32_MAX,                          lval = strtonum(argv[i + 2], 0, UINT32_MAX,
                             &errstr);                              &errstr);
                         if (errstr != NULL)                          if (errstr != NULL)
                                 errx(1, "%s: Bad value notation (%s)", argv[i],                                  errx(1, "%s: Bad value notation (%s)", argv[i],
Line 1470 
Line 1470 
                                 tmpstr = endstr + 1;                                  tmpstr = endstr + 1;
                         } while (endstr[0] != '\0');                          } while (endstr[0] != '\0');
                         goto pastestring;                          goto pastestring;
                 case 'u':  
                 case 'i':                  case 'i':
                         lval = strtonum(argv[i + 2], LLONG_MIN, LLONG_MAX,                          lval = strtonum(argv[i + 2], INT32_MIN, INT32_MAX,
                             &errstr);                              &errstr);
                         if (errstr != NULL)                          if (errstr != NULL)
                                 errx(1, "%s: Bad value notation (%s)", argv[i],                                  errx(1, "%s: Bad value notation (%s)", argv[i],
Line 1506 
Line 1505 
                         free(str);                          free(str);
                         break;                          break;
                 case 't':                  case 't':
                         lval = strtonum(argv[i + 2], LLONG_MIN, LLONG_MAX,                          lval = strtonum(argv[i + 2], 0, UINT32_MAX,
                             &errstr);                              &errstr);
                         if (errstr != NULL)                          if (errstr != NULL)
                                 errx(1, "%s: Bad value notation (%s)", argv[i],                                  errx(1, "%s: Bad value notation (%s)", argv[i],
Line 1514 
Line 1513 
                         if ((varbind = ober_printf_elements(varbind, "{Oit}",                          if ((varbind = ober_printf_elements(varbind, "{Oit}",
                             &oid, lval, BER_CLASS_APPLICATION,                              &oid, lval, BER_CLASS_APPLICATION,
                             SNMP_T_TIMETICKS)) == NULL)                              SNMP_T_TIMETICKS)) == NULL)
                                   err(1, "ober_printf_elements");
                           break;
                   case 'u':
                           lval = strtonum(argv[i + 2], 0, UINT32_MAX,
                               &errstr);
                           if (errstr != NULL)
                                   errx(1, "%s: Bad value notation (%s)", argv[i],
                                       argv[i + 2]);
                           if ((varbind = ober_printf_elements(varbind, "{Oit}",
                               &oid, lval, BER_CLASS_APPLICATION,
                               SNMP_T_GAUGE32)) == NULL)
                                 err(1, "ober_printf_elements");                                  err(1, "ober_printf_elements");
                         break;                          break;
                 case 'x':                  case 'x':

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33