fprintf(fp, "%s\n", cookie);
wallet_PutLine(fp, cookie,TRUE);
wallet_PostEdit() {  nsAutoString * nsCookie = new nsAutoString("");  nsIURL* url;  char* separator;  nsINetService *netservice;  nsresult res;  res = nsServiceManager::GetService(kNetServiceCID,                                     kINetServiceIID,                                     (nsISupports **)&netservice);  if ((NS_OK == res) && (nsnull != netservice)) {    const nsAutoString walletEditor = nsAutoString(WALLET_EDITOR_URL);    if (!NS_FAILED(NS_NewURL(&url, walletEditor))) {      res = netservice->GetCookieString(url, *nsCookie);    }    NS_RELEASE(netservice);    /* convert cookie to a C string */    char *cookies = nsCookie->ToNewCString();    char *cookie = PL_strstr(cookies, "SchemaToValue="); /* get to SchemaToValue= */    cookie = cookie + PL_strlen("SchemaToValue="); /* get passed htmldlgs=| */    /* return if OK button was not pressed */    separator = strchr(cookie, BREAK);    *separator = '\0';    if (strcmp(cookie, "OK")) {      *separator = BREAK;      delete cookies;      return;    }    cookie = separator+1;    *separator = BREAK;    /* open SchemaValue file */    FILE* fp = fopen("SchemaValue.tbl", "w");    if (nsnull==fp) {      delete cookies;      return;    }    /* write the values in the cookie to the file */    for (int i=0; ((*cookie != '\0') && (*cookie != ';')); i++) {      separator = strchr(cookie, BREAK);      *separator = '\0';      fprintf(fp, "%s\n", cookie);      cookie = separator+1;      *separator = BREAK;    }    /* close the file and read it back into the SchemaToValue list */    fclose(fp);    wallet_Clear(&wallet_SchemaToValue_list);    wallet_ReadFromFile("SchemaValue.tbl", wallet_SchemaToValue_list);    delete cookies;  }}