nsAutoString userStr; nsAutoString pwdStr;
nsAutoString userStr(*username); nsAutoString pwdStr(*password);
stub_PromptUsernameAndPassword(MWContext *context,                               const char *msg,                               char **username,                               char **password){  nsINetSupport *ins;  XP_Bool bResult = FALSE;      if (nsnull != (ins = getNetSupport(context->modular_data))) {    nsAutoString str(msg);    nsAutoString userStr;    nsAutoString pwdStr;    if (ins->PromptUserAndPassword(msg, userStr, pwdStr)) {      *username = userStr.ToNewCString();      *password = pwdStr.ToNewCString();      bResult = TRUE;    }    NS_RELEASE(ins);  }   /* No nsINetSupport interface... */  else {    char buf[256];    printf("%s\n", msg);    printf("%cUsername: ", '\007');    scanf("%s", buf);    *username = PL_strdup(buf);    printf("%cPassword: ", '\007');    scanf("%s", buf);    *password = PL_strdup(buf);    if (**username) {       bResult = TRUE;    } else {      PR_FREEIF(*username);      PR_FREEIF(*password);    }  }  return bResult;}