Print this page
10132 smatch fixes for MDB
Reviewed by: Andy Fiddaman <andy@omniosce.org>

@@ -22,11 +22,13 @@
 /*
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
+/*
+ * Copyright (c) 2018, Joyent, Inc.
+ */
 
 #include "ndievents.h"
 #include <sys/sunndi.h>
 #include <sys/ndi_impldefs.h>
 #include <sys/dditypes.h>

@@ -78,11 +80,11 @@
             (uintptr_t)device->devi_node_name) == -1) {
                 return (-1);
         }
 
         if (device->devi_node_state < DS_INITIALIZED) {
-                strncpy(addr_str, '\0', sizeof ('\0'));
+                addr_str[0] = '\0';
         } else {
                 addr = device->devi_addr;
                 if (mdb_readstr(addr_str, sizeof (addr_str),
                     (uintptr_t)addr) == -1) {
                         return (-1);