Print this page
patch fix-lint

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdisasm/common/dis_sparc_fmt.c
          +++ new/usr/src/lib/libdisasm/common/dis_sparc_fmt.c
↓ open down ↓ 41 lines elided ↑ open up ↑
  42   42  #include "libdisasm_impl.h"
  43   43  #include "dis_sparc.h"
  44   44  #include "dis_sparc_fmt.h"
  45   45  
  46   46  extern char *strncpy(char *, const char *, size_t);
  47   47  extern size_t strlen(const char *);
  48   48  extern int strcmp(const char *, const char *);
  49   49  extern int strncmp(const char *, const char *, size_t);
  50   50  extern size_t strlcat(char *, const char *, size_t);
  51   51  extern size_t strlcpy(char *, const char *, size_t);
  52      -extern int snprintf(char *, size_t, const char *, ...);
  53      -extern int vsnprintf(char *, size_t, const char *, va_list);
  54   52  
  55   53  /*
  56   54   * This file has the functions that do all the dirty work of outputting the
  57   55   * disassembled instruction
  58   56   *
  59   57   * All the non-static functions follow the format_fcn (in dis_sparc.h):
  60   58   * Input:
  61   59   *      disassembler handle/context
  62   60   *      instruction to disassemble
  63   61   *      instruction definition pointer (inst_t *)
↓ open down ↓ 792 lines elided ↑ open up ↑
 856  854  
 857  855          if ((flags & FLG_PRED) != 0) {
 858  856                  if (f->f2b.p == 0) {
 859  857                          pred = ",pn";
 860  858                  } else {
 861  859                          if ((dhx->dhx_debug & DIS_DEBUG_COMPAT) != 0)
 862  860                                  pred = ",pt";
 863  861                  }
 864  862          }
 865  863  
 866      -        (void) snprintf(buf, sizeof (buf), "%s%s%s", name, annul, pred);
      864 +        (void) dis_snprintf(buf, sizeof (buf), "%s%s%s", name, annul, pred);
 867  865          prt_name(dhp, buf, 1);
 868  866  
 869  867  
 870  868          switch (FLG_DISP_VAL(flags)) {
 871  869          case DISP22:
 872  870                  bprintf(dhp,
 873  871                      (octal != 0) ? "%s0%-11lo <" : "%s0x%-10lx <",
 874  872                      (disp < 0) ? "-" : "+",
 875  873                      (disp < 0) ? (-disp) : disp);
 876  874                  break;
↓ open down ↓ 1884 lines elided ↑ open up ↑
2761 2759  static void
2762 2760  bprintf(dis_handle_t *dhp, const char *fmt, ...)
2763 2761  {
2764 2762          dis_handle_sparc_t *dhx = dhp->dh_arch_private;
2765 2763          size_t curlen;
2766 2764          va_list ap;
2767 2765  
2768 2766          curlen = strlen(dhx->dhx_buf);
2769 2767  
2770 2768          va_start(ap, fmt);
2771      -        (void) vsnprintf(dhx->dhx_buf + curlen, dhx->dhx_buflen - curlen, fmt,
2772      -            ap);
     2769 +        (void) dis_vsnprintf(dhx->dhx_buf + curlen, dhx->dhx_buflen -
     2770 +            curlen, fmt, ap);
2773 2771          va_end(ap);
2774 2772  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX