Source-Changes-HG archive

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

[src/netbsd-3]: src/sbin/drvctl Pull up revision 1.4 (requested by lukem in t...



details:   https://anonhg.NetBSD.org/src/rev/7373af9207a8
branches:  netbsd-3
changeset: 576219:7373af9207a8
user:      tron <tron%NetBSD.org@localhost>
date:      Tue Jun 14 20:39:52 2005 +0000

description:
Pull up revision 1.4 (requested by lukem in ticket #401):
Fix an uninitialized variable issue.
Found with gcc -Wuninitialized.

diffstat:

 sbin/drvctl/drvctl.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r bfa4501d6e33 -r 7373af9207a8 sbin/drvctl/drvctl.c
--- a/sbin/drvctl/drvctl.c      Tue Jun 14 20:35:49 2005 +0000
+++ b/sbin/drvctl/drvctl.c      Tue Jun 14 20:39:52 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.3 2005/01/20 15:56:30 xtraeme Exp $ */
+/* $NetBSD: drvctl.c,v 1.3.2.1 2005/06/14 20:39:52 tron Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -60,6 +60,7 @@
        struct devrescanargs raa;
        int *locs, i;
 
+       mode = 0;
        while ((c = getopt(argc, argv, OPTS)) != -1) {
                switch (c) {
                case 'd':
@@ -78,7 +79,7 @@
        argc -= optind;
        argv += optind;
 
-       if (argc < 1)
+       if (argc < 1 || mode == 0)
                usage();
 
        fd = open(DRVCTLDEV, O_RDWR, 0);



Home | Main Index | Thread Index | Old Index