WALLET_FREEIF(*lineCString); *lineCString = ToNewCString(line);
wallet_GetLine(nsInputFileStream& strm, const char** lineCString){  const PRUint32 kInitialStringCapacity = 64;  nsCAutoString line;  /* read the line */  line.Truncate(0);    PRInt32 stringLen = 0;  PRInt32 stringCap = kInitialStringCapacity;  line.SetCapacity(stringCap);    char c;  static char lastC = '\0';  for (;;) {    c = wallet_Get(strm);    /* check for eof */    if (c == 0) {      return NS_ERROR_FAILURE;    }    /* check for line terminator (mac=CR, unix=LF, win32=CR+LF */    if (c == '\n' && lastC == '\r') {        continue; /* ignore LF if preceded by a CR */    }    lastC = c;    if (c == '\n' || c == '\r') {      break;    }    stringLen ++;    // buffer string grows    if (stringLen == stringCap)    {      stringCap += stringCap;   // double buffer len      line.SetCapacity(stringCap);    }    line += c;  }  WALLET_FREEIF(*lineCString);  *lineCString = ToNewCString(line);  return NS_OK;}