char * cryptCString;
char * cryptCString = nsnull;
Wallet_Encrypt (nsAutoString text, nsAutoString& crypt) {  /* convert text from unichar to UTF8 */  nsAutoString UTF8text = "";  PRUnichar c;  for (PRUint32 i=0; i<text.Length(); i++) {    c = text.CharAt(i);    if (c <= 0x7F) {      UTF8text += (char)c;    } else if (c <= 0x7FF) {      UTF8text += ((PRUnichar)0xC0) | ((c>>6) & 0x1F);      UTF8text += ((PRUnichar)0x80) | (c & 0x3F);    } else {      UTF8text += ((PRUnichar)0xE0) | ((c>>12) & 0xF);      UTF8text += ((PRUnichar)0x80) | ((c>>6) & 0x3F);      UTF8text += ((PRUnichar)0x80) | (c & 0x3F);    }  }    /* encrypt text to crypt */  char * cryptCString;  char * UTF8textCString = UTF8text.ToNewCString();#if TESTING_CRYPTO  nsresult rv = EncryptString(UTF8textCString, cryptCString);#else  nsresult rv = wallet_CryptSetup();  if (NS_SUCCEEDED(rv)) {    rv = gSecretDecoderRing->EncryptString(UTF8textCString, &cryptCString);  }#endif  Recycle (UTF8textCString);  if NS_FAILED(rv) {    return rv;  }  crypt = cryptCString;  Recycle (cryptCString);  return NS_OK;}