separator = strchr(nextItem, BREAK); if (!separator) { delete[] walletListAsCString;
if (head != "OK") {
WLLT_PostEdit(nsAutoString walletList) {  if (!Wallet_KeySet()) {    return;  }  char* separator;  nsFileSpec dirSpec;  nsresult rv = Wallet_ProfileDirectory(dirSpec);  if (NS_FAILED(rv)) {    return;  }  /* convert walletList to a C string */  char *walletListAsCString = walletList.ToNewCString();  char *nextItem = walletListAsCString;  /* return if OK button was not pressed */  separator = strchr(nextItem, BREAK);  if (!separator) {    delete[] walletListAsCString;     return;  }  *separator = '\0';  if (PL_strcmp(nextItem, "OK")) {    *separator = BREAK;    delete []walletListAsCString;    return;  }  nextItem = separator+1;  *separator = BREAK;  /* open SchemaValue file */  nsOutputFileStream strm(dirSpec + schemaValueFileName);  if (!strm.is_open()) {    NS_ERROR("unable to open file");    delete []walletListAsCString;    return;  }  Wallet_RestartKey();  /* write the values in the walletList to the file */  for (int i=0; (*nextItem != '\0'); i++) {    separator = strchr(nextItem, BREAK);    if (!separator) {      strm.close();      delete[] walletListAsCString;       return;    }    *separator = '\0';    if (NS_FAILED(wallet_PutLine(strm, nextItem, PR_TRUE))) {      break;    }    nextItem = separator+1;    *separator = BREAK;  }  /* close the file and read it back into the SchemaToValue list */  strm.close();  wallet_Clear(&wallet_SchemaToValue_list);  wallet_ReadFromFile(schemaValueFileName, wallet_SchemaToValue_list, PR_TRUE, PR_TRUE);  delete []walletListAsCString;}