Print this page
11227 smb code needs smatch fixes

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/smbsrv/test-msgbuf/test_main.c
          +++ new/usr/src/cmd/smbsrv/test-msgbuf/test_main.c
↓ open down ↓ 3 lines elided ↑ open up ↑
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
       14 + * Copyright 2019 Joyent, Inc.
  14   15   */
  15   16  
  16   17  /*
  17   18   * Test & debug program for smb_msgbuf.c and smb_mbuf_marshaling.c
  18   19   */
  19   20  
  20   21  #include <sys/types.h>
  21   22  #include <sys/debug.h>
  22   23  
  23   24  #include <stdio.h>
↓ open down ↓ 33 lines elided ↑ open up ↑
  57   58                  }
  58   59                  if (*buf > ' ' && *buf <= '~')
  59   60                          *pa++ = *buf;
  60   61                  else
  61   62                          *pa++ = '.';
  62   63                  printf("%02x ", *buf++);
  63   64  
  64   65                  idx++;
  65   66                  if ((idx & 3) == 0) {
  66   67                          *pa++ = ' ';
  67      -                        putchar(' ');
       68 +                        (void) putchar(' ');
  68   69                  }
  69   70                  if ((idx & 15) == 0) {
  70   71                          *pa = '\0';
  71   72                          printf("%s\n", ascii);
  72   73                  }
  73   74          }
  74   75  
  75   76          if ((idx & 15) != 0) {
  76   77                  *pa = '\0';
  77   78                  /* column align the last ascii row */
  78   79                  while ((idx & 15) != 0) {
  79   80                          if ((idx & 3) == 0)
  80      -                                putchar(' ');
       81 +                                (void) putchar(' ');
  81   82                          printf("   ");
  82   83                          idx++;
  83   84                  }
  84   85                  printf("%s\n", ascii);
  85   86          }
  86   87  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX