From: Ezra Peisach Date: Thu, 21 Jun 2001 14:25:10 +0000 (+0000) Subject: * main.c (get_params): Change optind to optindex to prevent X-Git-Tag: krb5-1.3-alpha1~1336 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ba2d3d7da029bb0da6a058a953787b754bbf7e53;p=krb5.git * 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 --- diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog index cbc56a76f..ef3f0e895 100644 --- a/src/clients/ksu/ChangeLog +++ b/src/clients/ksu/ChangeLog @@ -1,3 +1,8 @@ +2001-06-21 Ezra Peisach + + * main.c (get_params): Change optind to optindex to prevent + shadowing. + 2001-06-18 Ezra Peisach * 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 fe8adb693..f8992a7b8 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;