diff options
author | Ezra Peisach <epeisach@mit.edu> | 2001-06-21 14:25:10 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2001-06-21 14:25:10 +0000 |
commit | ba2d3d7da029bb0da6a058a953787b754bbf7e53 (patch) | |
tree | 10b2f3c26d18cccd3e3a366f0eb7becb03ef1c3a /src | |
parent | 0e31c99c154bc28bae9c5193239d73757f2fec86 (diff) | |
download | krb5-ba2d3d7da029bb0da6a058a953787b754bbf7e53.tar.gz krb5-ba2d3d7da029bb0da6a058a953787b754bbf7e53.tar.xz krb5-ba2d3d7da029bb0da6a058a953787b754bbf7e53.zip |
* main.c (get_params): Change optind to optindex to prevent
shadowing.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13450 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r-- | src/clients/ksu/ChangeLog | 5 | ||||
-rw-r--r-- | src/clients/ksu/main.c | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog index cbc56a76f2..ef3f0e8950 100644 --- a/src/clients/ksu/ChangeLog +++ b/src/clients/ksu/ChangeLog @@ -1,3 +1,8 @@ +2001-06-21 Ezra Peisach <epeisach@mit.edu> + + * main.c (get_params): Change optind to optindex to prevent + shadowing. + 2001-06-18 Ezra Peisach <epeisach@mit.edu> * main.c (main): Cast arguments to print_status to be consitant diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c index fe8adb6934..f8992a7b8a 100644 --- a/src/clients/ksu/main.c +++ b/src/clients/ksu/main.c @@ -908,15 +908,15 @@ static void sweep_up(context, cc) get_params is to be called for the -a option or -e option to collect all params passed in for the shell or for cmd. An aray is returned containing all params. - optind is incremented accordingly and the first + optindex is incremented accordingly and the first element in the returned array is reserved for the name of the command to be executed or the name of the shell. *****************************************************************/ krb5_error_code -get_params(optind, pargc, pargv, params) - int *optind; +get_params(optindex, pargc, pargv, params) + int *optindex; int pargc; char **pargv; char ***params; @@ -924,15 +924,15 @@ get_params(optind, pargc, pargv, params) int i,j; char ** ret_params; - int size = pargc - *optind + 2; + int size = pargc - *optindex + 2; if ((ret_params = (char **) calloc(size, sizeof (char *)))== NULL ){ return errno; } - for (i = *optind, j=1; i < pargc; i++,j++){ + for (i = *optindex, j=1; i < pargc; i++,j++){ ret_params[j] = pargv[i]; - *optind = *optind + 1; + *optindex = *optindex + 1; } ret_params[size-1] = NULL; |