((char **)submit.value_array)[j] )) {
(submit.value_array)[j] )) {
SINGSIGN_RememberSignonData       (char* URLName, char** name_array, char** value_array, char** type_array, PRInt32 value_cnt){  int passwordCount = 0;  int pswd[3];  LO_FormSubmitData submit;  submit.name_array = (PA_Block)name_array;  submit.value_array = (PA_Block)value_array;  submit.type_array = (PA_Block)type_array;  submit.value_cnt = value_cnt;  /* do nothing if signon preference is not enabled */  if (!si_GetSignonRememberingPref()){    return;  }  /* determine how many passwords are in the form and where they are */  for (PRInt32 i=0; i<submit.value_cnt; i++) {    if (((uint8 *)submit.type_array)[i] == FORM_TYPE_PASSWORD) {      if (passwordCount < 3 ) {        pswd[passwordCount] = i;      }      passwordCount++;    }  }  /* process the form according to how many passwords it has */  if (passwordCount == 1) {    /* one-password form is a log-in so remember it */    /* obtain the index of the first input field (that is the username) */    PRInt32 j;    for (j=0; j<submit.value_cnt; j++) {      if (((uint8 *)submit.type_array)[j] == FORM_TYPE_TEXT) {        break;      }    }    if ((j<submit.value_cnt) && si_OkToSave(URLName, /* urlname */        ((char **)submit.value_array)[j] /* username */)) {      SI_LoadSignonData(PR_TRUE);      si_PutData(URLName, &submit, PR_TRUE);    }  } else if (passwordCount == 2) {    /* two-password form is a registration */  } else if (passwordCount == 3) {    /* three-password form is a change-of-password request */    si_SignonDataStruct* data;    si_SignonUserStruct* user;    /* make sure all passwords are non-null and 2nd and 3rd are identical */    if (!submit.value_array[pswd[0]] || ! submit.value_array[pswd[1]] ||        !submit.value_array[pswd[2]] ||        PL_strcmp(((char **)submit.value_array)[pswd[1]],          ((char **)submit.value_array)[pswd[2]])) {      return;    }    /* ask user if this is a password change */    si_lock_signon_list();    user = si_GetURLAndUserForChangeForm(((char **)submit.value_array)[pswd[0]]);    /* return if user said no */    if (!user) {      si_unlock_signon_list();      return;    }    /* get to password being saved */    SI_LoadSignonData(PR_TRUE); /* this destroys "user" so we need to recalculate it */    user = si_GetURLAndUserForChangeForm(((char **)submit.value_array)[pswd[0]]);    if (!user) { /* this should never happen but just in case */      si_unlock_signon_list();      return;    }    PRInt32 dataCount = LIST_COUNT(user->signonData_list);    for (PRInt32 k=0; k<dataCount; k++) {      data = NS_STATIC_CAST(si_SignonDataStruct*, user->signonData_list->ElementAt(k));      if (data->isPassword) {        break;      }    }    /*     * if second password is "generate" then generate a random     * password for it and use same random value for third password     * as well (Note: this all works because we already know that     * second and third passwords are identical so third password     * must also be "generate".  Furthermore si_Randomize() will     * create a random password of exactly eight characters -- the     * same length as "generate".)     */    si_Randomize(((char **)submit.value_array)[pswd[1]]);    PL_strcpy(((char **)submit.value_array)[pswd[2]],((char **)submit.value_array)[pswd[1]]);    StrAllocCopy(data->value, ((char **)submit.value_array)[pswd[1]]);    si_signon_list_changed = PR_TRUE;    si_SaveSignonDataLocked(PR_TRUE);    si_unlock_signon_list();  }}