[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.27 and 1.28

version 1.27, 2020/06/30 19:26:40 version 1.28, 2020/08/03 14:45:54
Line 29 
Line 29 
 #include <ctype.h>  #include <ctype.h>
 #include <err.h>  #include <err.h>
 #include <errno.h>  #include <errno.h>
   #include <locale.h>
 #include <netdb.h>  #include <netdb.h>
 #include <poll.h>  #include <poll.h>
 #include <stdio.h>  #include <stdio.h>
Line 103 
Line 104 
 size_t walk_skip_len = 0;  size_t walk_skip_len = 0;
 enum smi_oid_lookup oid_lookup = smi_oidl_short;  enum smi_oid_lookup oid_lookup = smi_oidl_short;
 enum smi_output_string output_string = smi_os_default;  enum smi_output_string output_string = smi_os_default;
   int utf8 = 0;
   
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
Line 129 
Line 131 
         int ch;          int ch;
         size_t i;          size_t i;
   
           /*
            * Determine if output can handle UTF-8 based on locale.
            */
           setlocale(LC_CTYPE, "");
           utf8 = MB_CUR_MAX > 1;
           /*
            * SMIv2 allows for UTF-8 text at some locations.
            * Set it explicitly so we can handle it on the input side.
            */
           if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL)
                   errx(1, "setlocale(LC_CTYPE, \"en_US.UTF-8\") failed");
   
         if (pledge("stdio inet dns unix", NULL) == -1)          if (pledge("stdio inet dns unix", NULL) == -1)
                 err(1, "pledge");                  err(1, "pledge");
   
Line 1069 
Line 1083 
         }          }
   
         elm = elm->be_next;          elm = elm->be_next;
         value = smi_print_element(elm, smi_print_hint, output_string, oid_lookup);          value = smi_print_element(&oid, elm, smi_print_hint, output_string,
               oid_lookup, utf8);
         if (value == NULL)          if (value == NULL)
                 return 0;                  return 0;
   

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28