cname = name.ToNewCString();
cname = ToNewCString(name);
PageGrabber::NextFile(const char* aExtension){  char* cname = nsnull;  nsAutoString name;  for (;;) {    name.Truncate();    name.Append(mDirectory);    char fileName[20];    PR_snprintf(fileName, sizeof(fileName), "%08d.%s", mFileNum, aExtension);    name.Append(fileName);    // See if file already exists; if it does advance mFileNum by 100 and    // try again.    cname = name.ToNewCString();    struct stat sb;    int s = stat(cname, &sb);    if (s < 0) {      mFileNum++;      break;    }    else {      mFileNum += 100;      delete [] cname;    }  }  return cname;}