Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/sbin/scsictl Pull up revision 1.28 (requested by lukem in...



details:   https://anonhg.NetBSD.org/src/rev/3d275e55d6c6
branches:  netbsd-3
changeset: 576220:3d275e55d6c6
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jun 14 20:41:06 2005 +0000

description:
Pull up revision 1.28 (requested by lukem in ticket #402):
Ensure that "setcache <mode>" doesn't use random data for "byte2"
("setcache <mode> save" DTRT).
Found by gcc -Wuninitialized.
Appease other -Wuninitialized warnings.

diffstat:

 sbin/scsictl/scsictl.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 7373af9207a8 -r 3d275e55d6c6 sbin/scsictl/scsictl.c
--- a/sbin/scsictl/scsictl.c    Tue Jun 14 20:39:52 2005 +0000
+++ b/sbin/scsictl/scsictl.c    Tue Jun 14 20:41:06 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsictl.c,v 1.27 2005/02/21 00:29:08 thorpej Exp $     */
+/*     $NetBSD: scsictl.c,v 1.27.2.1 2005/06/14 20:41:06 tron Exp $    */
 
 /*-
  * Copyright (c) 1998, 2002 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@
 #include <sys/cdefs.h>
 
 #ifndef lint
-__RCSID("$NetBSD: scsictl.c,v 1.27 2005/02/21 00:29:08 thorpej Exp $");
+__RCSID("$NetBSD: scsictl.c,v 1.27.2.1 2005/06/14 20:41:06 tron Exp $");
 #endif
 
 
@@ -253,6 +253,8 @@
                errx(1, "unable to allocate defect list");
        memset(data, 0, dlen);
        memset(&cmd, 0, sizeof(cmd));
+       defects = 0;
+       pfunc = NULL;
 
        /* determine which defect list(s) to read. */
        for (i = 0; i < argc; i++) {
@@ -883,6 +885,8 @@
        if (argc > 2 || argc == 0)
                usage();
 
+       flags = 0;
+       byte2 = 0;
        if (strcmp(argv[0], "none") == 0)
                flags = CACHING_RCD;
        else if (strcmp(argv[0], "r") == 0)



Home | Main Index | Thread Index | Old Index