]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
vos: aserver is private
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 19 Feb 2013 14:44:14 +0000 (14:44 +0000)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Feb 2013 06:02:37 +0000 (22:02 -0800)
The server specified on the command line is used directly to
initialise the attributes structure. Move the variable so it's
local to the block which uses it, and remove the function-wide
initialiser.

Caught by clang-analyzer

Change-Id: Ia636fae2ed505f6958cefbfbaa72ef7e37edec98
Reviewed-on: http://gerrit.openafs.org/9165
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/volser/vos.c

index 429fbce6f6992a8d8f88e77e74a52d938f90cef9..30a35e27ed70b0d39bb7d30145dd1f1a4077c6c5 100644 (file)
@@ -4476,7 +4476,6 @@ static int
 ListVLDB(struct cmd_syndesc *as, void *arock)
 {
     afs_int32 apart;
-    afs_uint32 aserver;
     afs_int32 code;
     afs_int32 vcode;
     struct VldbListByAttributes attributes;
@@ -4490,7 +4489,6 @@ ListVLDB(struct cmd_syndesc *as, void *arock)
     int quiet, sort, lock;
     afs_int32 thisindex, nextindex;
 
-    aserver = 0;
     apart = 0;
 
     attributes.Mask = 0;
@@ -4517,6 +4515,8 @@ ListVLDB(struct cmd_syndesc *as, void *arock)
 
     /* Server specified */
     if (as->parms[1].items) {
+       afs_uint32 aserver;
+
        aserver = GetServer(as->parms[1].items->data);
        if (aserver == 0) {
            fprintf(STDERR, "vos: server '%s' not found in host table\n",