Print this page
11227 smb code needs smatch fixes

@@ -9,10 +9,11 @@
  * http://www.illumos.org/license/CDDL.
  */
 
 /*
  * Copyright 2018 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2019 Joyent, Inc.
  */
 
 /*
  * Test & debug program for oplocks
  *

@@ -163,13 +164,14 @@
         if (ofile->f_refcnt) {
                 printf("open fid %d already opened\n");
                 return;
         }
 
-        if (arg2 != NULL)
-                strlcpy((char *)ofile->TargetOplockKey, arg2,
+        if (arg2 != NULL) {
+                (void) strlcpy((char *)ofile->TargetOplockKey, arg2,
                     SMB_LEASE_KEY_SZ);
+        }
 
         ofile->f_refcnt++;
         node->n_open_count++;
         smb_llist_insert_tail(&node->n_ofile_list, ofile);
         printf(" open %d OK\n", fid);

@@ -395,11 +397,11 @@
                 f->f_node = &test_node;
         }
 
         for (;;) {
                 if (prompt) {
-                        fputs(prompt, stdout);
+                        (void) fputs(prompt, stdout);
                         fflush(stdout);
                 }
 
                 cmd = fgets(cmdbuf, sizeof (cmdbuf), stdin);
                 if (cmd == NULL)

@@ -407,21 +409,21 @@
                 if (cmd[0] == '#')
                         continue;
 
                 if (prompt == NULL) {
                         /* Put commands in the output too. */
-                        fputs(cmdbuf, stdout);
+                        (void) fputs(cmdbuf, stdout);
                 }
                 cmd = strtok_r(cmd, sep, &savep);
                 if (cmd == NULL)
                         continue;
 
                 /*
                  * Commands with no args
                  */
                 if (0 == strcmp(cmd, "help")) {
-                        fputs(helpstr, stdout);
+                        (void) fputs(helpstr, stdout);
                         continue;
                 }
 
                 if (0 == strcmp(cmd, "show")) {
                         do_show();