Module Name:    src
Committed By:   dyoung
Date:           Fri Apr 17 20:25:08 UTC 2009

Modified Files:
        src/usr.bin/passwd: local_passwd.c passwd.c

Log Message:
Rename variables to fix GCC warnings: local variables optopt and optarg
shadow globals.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.bin/passwd/local_passwd.c
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/passwd/passwd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/passwd/local_passwd.c
diff -u src/usr.bin/passwd/local_passwd.c:1.32 src/usr.bin/passwd/local_passwd.c:1.33
--- src/usr.bin/passwd/local_passwd.c:1.32	Sun Apr 12 23:59:37 2009
+++ src/usr.bin/passwd/local_passwd.c	Fri Apr 17 20:25:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: local_passwd.c,v 1.32 2009/04/12 23:59:37 lukem Exp $	*/
+/*	$NetBSD: local_passwd.c,v 1.33 2009/04/17 20:25:08 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)local_passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: local_passwd.c,v 1.32 2009/04/12 23:59:37 lukem Exp $");
+__RCSID("$NetBSD: local_passwd.c,v 1.33 2009/04/17 20:25:08 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -228,9 +228,9 @@
 }
 
 int
-local_arg(char arg, const char *optarg)
+local_arg(char ch, const char *arg)
 {
-	switch (arg) {
+	switch (ch) {
 	case 'l':
 		force_local = 1;
 		break;

Index: src/usr.bin/passwd/passwd.c
diff -u src/usr.bin/passwd/passwd.c:1.29 src/usr.bin/passwd/passwd.c:1.30
--- src/usr.bin/passwd/passwd.c:1.29	Sun Apr 12 23:59:37 2009
+++ src/usr.bin/passwd/passwd.c	Fri Apr 17 20:25:08 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: passwd.c,v 1.29 2009/04/12 23:59:37 lukem Exp $	*/
+/*	$NetBSD: passwd.c,v 1.30 2009/04/17 20:25:08 dyoung Exp $	*/
 
 /*
  * Copyright (c) 1988, 1993, 1994
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: passwd.c,v 1.29 2009/04/12 23:59:37 lukem Exp $");
+__RCSID("$NetBSD: passwd.c,v 1.30 2009/04/17 20:25:08 dyoung Exp $");
 #endif
 #endif /* not lint */
 
@@ -250,7 +250,7 @@
 	int ch;
 	char *username;
 	char optstring[64];  /* if we ever get more than 64 args, shoot me. */
-	const char *curopt, *optopt;
+	const char *curopt, *oopt;
 	int i, j;
 	int valid;
 	int use_always;
@@ -306,15 +306,15 @@
 
 		curopt = pw_modules[i].args;
 		while (*curopt != '\0') {
-			if ((optopt = strchr(optstring, *curopt)) == NULL) {
+			if ((oopt = strchr(optstring, *curopt)) == NULL) {
 				optstring[j++] = *curopt;
 				if (curopt[1] == ':') {
 					curopt++;
 					optstring[j++] = *curopt;
 				}
 				optstring[j] = '\0';
-			} else if ((optopt[1] == ':' && curopt[1] != ':') ||
-			    (optopt[1] != ':' && curopt[1] == ':')) {
+			} else if ((oopt[1] == ':' && curopt[1] != ':') ||
+			    (oopt[1] != ':' && curopt[1] == ':')) {
 				errx(1, "NetBSD ERROR!  Different password "
 				    "modules have two different ideas about "
 				    "%c argument format.", curopt[0]);
@@ -329,8 +329,8 @@
 		for (i = 0; pw_modules[i].pw_init != NULL; i++) {
 			if (pw_modules[i].invalid)
 				continue;
-			if ((optopt = strchr(pw_modules[i].args, ch)) != NULL) {
-				j = (optopt[1] == ':') ?
+			if ((oopt = strchr(pw_modules[i].args, ch)) != NULL) {
+				j = (oopt[1] == ':') ?
 				    ! (*pw_modules[i].pw_arg)(ch, optarg) :
 				    ! (*pw_modules[i].pw_arg)(ch, NULL);
 				if (j != 0)

Reply via email to