*(list2++) = userName.ToNewUnicode();
*(list2++) = ToNewUnicode(userName);
si_GetUser(nsIPrompt* dialog, const char* passwordRealm, PRBool pickFirstUser, const nsString& userText) {  si_SignonURLStruct* url;  si_SignonUserStruct* user = nsnull;  si_SignonDataStruct* data;  /* get to node for this URL */  url = si_GetURL(passwordRealm);  if (url != NULL) {    /* node for this URL was found */    PRInt32 user_count;    if ((user_count = url->signonUser_list.Count()) == 1) {      /* only one set of data exists for this URL so select it */      user = NS_STATIC_CAST(si_SignonUserStruct *,                            url->signonUser_list.ElementAt(0));      url->chosen_user = user;    } else if (pickFirstUser) {      PRInt32 userCount = url->signonUser_list.Count();      for (PRInt32 i=0; i<userCount; i++) {        user = NS_STATIC_CAST(si_SignonUserStruct*, url->signonUser_list.ElementAt(i));        /* consider first data node to be the identifying item */        data = NS_STATIC_CAST(si_SignonDataStruct *,                              user->signonData_list.ElementAt(0));        if (data->name != userText) {          /* name of current data item does not match name in data node */          continue;        }        break;      }      url->chosen_user = user;    } else {      /* multiple users for this URL so a choice needs to be made */      PRUnichar ** list;      PRUnichar ** list2;      si_SignonUserStruct** users;      si_SignonUserStruct** users2;      list = (PRUnichar**)PR_Malloc(user_count*sizeof(PRUnichar*));      users = (si_SignonUserStruct **) PR_Malloc(user_count*sizeof(si_SignonUserStruct*));      list2 = list;      users2 = users;      /* step through set of user nodes for this URL and create list of       * first data node of each (presumably that is the user name).       * Note that the user nodes are already ordered by       * most-recently-used so the first one in the list is the most       * likely one to be chosen.       */      user_count = 0;      PRInt32 userCount = url->signonUser_list.Count();      for (PRInt32 i=0; i<userCount; i++) {        user = NS_STATIC_CAST(si_SignonUserStruct*, url->signonUser_list.ElementAt(i));        /* consider first data node to be the identifying item */        data = NS_STATIC_CAST(si_SignonDataStruct *,                              user->signonData_list.ElementAt(0));        if (data->name != userText) {          /* name of current data item does not match name in data node */          continue;        }        nsAutoString userName;        if (NS_SUCCEEDED(si_Decrypt (data->value, userName))) {          *(list2++) = userName.ToNewUnicode();          *(users2++) = user;          user_count++;        } else {          break;        }      }      /* have user select a username from the list */      PRUnichar * selectUser = Wallet_Localize("SelectUser");      if (user_count == 0) {        /* not first data node for any saved user, so simply pick first user */        if (url->chosen_user) {          user = url->chosen_user;        } else {          /* no user selection had been made for first data node */          user = NULL;        }       } else if (user_count == 1) {        /* only one user for this form at this url, so select it */        user = users[0];      } else if ((user_count > 1) && si_SelectDialog(selectUser, dialog, list, &user_count)) {        /* user pressed OK */        if (user_count == -1) {          user_count = 0; /* user didn't select, so use first one */        }        user = users[user_count]; /* this is the selected item */        /* item selected is now most-recently used, put at head of list */        url->signonUser_list.RemoveElement(user);        url->signonUser_list.InsertElementAt(user, 0);      } else {        user = NULL;      }      Recycle(selectUser);      url->chosen_user = user;      while (--list2 > list) {        Recycle(*list2);      }      PR_Free(list);      PR_Free(users);      /* if we don't remove the URL from the cache at this point, the       * cached copy will be brought containing the last-used username       * rather than the username that was just selected       */#ifdef junk      NET_RemoveURLFromCache(NET_CreateURLStruct((char *)passwordRealm, NET_DONT_RELOAD));#endif    }  } else {    user = NULL;  }  return user;}