ptserver: Don't print undefined value
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Tue, 15 Jun 2010 15:51:42 +0000 (16:51 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Sat, 23 Jul 2011 04:10:18 +0000 (21:10 -0700)
The readgroup utility printed the wrong variable when listing the
source group - instead of printing the group name, it tried to
print an arbitrary element from the list of group members. Fix it
to print the right thing.

Caught by clang-analyzer.

Change-Id: Ie7ada8a1e881871ae5db14714ee10325ac052d40
Reviewed-on: http://gerrit.openafs.org/5076
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/ptserver/readgroup.c

index 456916b..c48d135 100644 (file)
@@ -147,8 +147,7 @@ main(int argc, char **argv)
                    } else {
                        /* add the members of a group to the group */
                        if (verbose)
-                           printf("Adding %s to %s.\n",
-                                  lnames.namelist_val[i], gname);
+                           printf("Adding %s to %s.\n", name, gname);
                        code = pr_ListMembers(name, &lnames);
                        if (code) {
                            fprintf(stderr,