Print this page
8485 Remove set but unused variables in usr/src/cmd

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/krb5/ldap_util/kdb5_ldap_list.c
          +++ new/usr/src/cmd/krb5/ldap_util/kdb5_ldap_list.c
   1      -#pragma ident   "%Z%%M% %I%     %E% SMI"
   2      -
   3    1  /*
   4    2   * kadmin/ldap_util/kdb5_ldap_list.c
   5    3   */
   6    4  
   7    5  /* Copyright (c) 2004-2005, Novell, Inc.
   8    6   * All rights reserved.
   9    7   *
  10    8   * Redistribution and use in source and binary forms, with or without
  11    9   * modification, are permitted provided that the following conditions are met:
  12   10   *
↓ open down ↓ 144 lines elided ↑ open up ↑
 157  155   * (ADD or DELETE).
 158  156   */
 159  157  void list_modify_str_array(destlist, sourcelist, mode)
 160  158      char ***destlist;
 161  159      const char **sourcelist;
 162  160      int mode;
 163  161  {
 164  162      char **dlist = NULL, **tmplist = NULL;
 165  163      const char **slist = NULL;
 166  164      int dcount = 0, scount = 0, copycount = 0;
 167      -    int found = 0;
 168  165  
 169  166      if ((destlist == NULL) || (*destlist == NULL) || (sourcelist == NULL))
 170  167          return;
 171  168  
 172  169      /* We need to add every entry present in the source list to
 173  170       * the destination list */
 174  171      if (mode == LIST_MODE_ADD) {
 175  172          /* Traverse throught the end of destlist for appending */
 176  173          for (dlist = *destlist, dcount = 0; *dlist != NULL;
 177  174               dlist++, dcount++) {
↓ open down ↓ 15 lines elided ↑ open up ↑
 193  190              copycount = (MAX_LIST_ENTRIES -1) - dcount;
 194  191  
 195  192          memcpy(dlist, slist, (sizeof(char *) * copycount));
 196  193          dlist += copycount;
 197  194          *dlist = NULL;
 198  195      } else if (mode == LIST_MODE_DELETE) {
 199  196          /* We need to delete every entry present in the source list
 200  197           * from the destination list */
 201  198          for (slist = sourcelist; *slist != NULL; slist++) {
 202  199              for (dlist = *destlist; *dlist != NULL; dlist++) {
 203      -                found = 0; /* value not found */
 204  200                  /* DN is case insensitive string */
 205  201                  if (strcasecmp(*dlist, *slist) == 0) {
 206      -                    found = 1;
 207  202                      free(*dlist);
 208  203                      /* Advance the rest of the entries by one */
 209  204                      for (tmplist = dlist; *tmplist != NULL; tmplist++) {
 210  205                          *tmplist = *(tmplist+1);
 211  206                      }
 212  207                      break;
 213  208                  }
 214  209              }
 215  210          }
 216  211      }
↓ open down ↓ 73 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX