* main.c (get_params): Change optind to optindex to prevent
authorEzra Peisach <epeisach@mit.edu>
Thu, 21 Jun 2001 14:25:10 +0000 (14:25 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 21 Jun 2001 14:25:10 +0000 (14:25 +0000)
        shadowing.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13450 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/ksu/ChangeLog
src/clients/ksu/main.c

index cbc56a76f2af10cafb428f73661d13924d0552e3..ef3f0e8950626b9f59edfe7214c2a4f7a74b44b8 100644 (file)
@@ -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
index fe8adb69344de3f000669951082a30d53a721260..f8992a7b8a287e37c16ff50f231e9fea98c82b3b 100644 (file)
@@ -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;