Print this page
10138 smatch fixes for usr/src/cmd/sgs

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/sgs/libld/common/util.c
          +++ new/usr/src/cmd/sgs/libld/common/util.c
↓ open down ↓ 21 lines elided ↑ open up ↑
  22   22  /*
  23   23   * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27   27   *      Copyright (c) 1988 AT&T
  28   28   *        All Rights Reserved
  29   29   */
  30   30  
  31   31  /*
       32 + * Copyright (c) 2018, Joyent, Inc.
       33 + */
       34 +
       35 +/*
  32   36   * Utility functions
  33   37   */
  34   38  #include <unistd.h>
  35   39  #include <stdio.h>
  36   40  #include <stdarg.h>
  37   41  #include <string.h>
  38   42  #include <fcntl.h>
  39   43  #include <sys/types.h>
  40   44  #include <sys/mman.h>
  41   45  #include <errno.h>
↓ open down ↓ 270 lines elided ↑ open up ↑
 312  316   *      arg - Option to be examined
 313  317   *      c, opt - Option character (c) and corresponding long name (opt)
 314  318   *      optsz - 0 if option does not accept a value. If option does
 315  319   *              accept a value, strlen(opt), giving the offset to the
 316  320   *              value if the option and value are combined in one string.
 317  321   *      cbfunc - NULL, or pointer to function to call if a translation is
 318  322   *              successful.
 319  323   */
 320  324  static int
 321  325  str2chr(Lm_list *lml, int ndx, int argc, char **argv, char *arg, int c,
 322      -    const char *opt, size_t optsz, int cbfunc(int))
      326 +    const char *opt, size_t optsz, int (*cbfunc)(int))
 323  327  {
 324  328          if (optsz == 0) {
 325  329                  /*
 326  330                   * Compare a single option (ie. there's no associated option
 327  331                   * argument).
 328  332                   */
 329  333                  if (strcmp(arg, opt) == 0) {
 330  334                          DBG_CALL(Dbg_args_str2chr(lml, ndx, opt, c));
 331  335                          optind += 1;
 332  336                          optopt = c;
↓ open down ↓ 438 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX