char *s = (char *)PR_MALLOC(PL_strlen(p) + PL_strlen(id) + 1);
char *s = (char *)PR_MALLOC(nsCRT::strlen(p) + nsCRT::strlen(id) + 1);
MimeExternalObject_parse_begin (MimeObject *obj){  int status;    status = ((MimeObjectClass*)&MIME_SUPERCLASS)->parse_begin(obj);  if (status < 0) return status;  #ifdef XP_MAC  if (obj->parent && mime_typep(obj->parent,    (MimeObjectClass *) &mimeMultipartAppleDoubleClass))    goto done;#endif /* XP_MAC */      /* If we're writing this object, and we're doing it in raw form, then    now is the time to inform the backend what the type of this data is.  */  if (obj->output_p &&    obj->options &&    !obj->options->write_html_p &&    !obj->options->state->first_data_written_p)  {    status = MimeObject_output_init(obj, 0);    if (status < 0) return status;    PR_ASSERT(obj->options->state->first_data_written_p);  }      /* If we're writing this object as HTML, do all the work now -- just write     out a table with a link in it.  (Later calls to the `parse_buffer' method     will simply discard the data of the object itself.)  */  if (obj->options &&      obj->output_p &&      obj->options->write_html_p &&      obj->options->output_fn)  {    MimeDisplayOptions newopt = *obj->options;  /* copy it */    char *id = 0;    char *id_url = 0;    char *id_name = 0;    char *id_imap = 0;    PRBool all_headers_p = obj->options->headers == MimeHeadersAll;        id = mime_part_address (obj);    if (obj->options->missing_parts)      id_imap = mime_imap_part_address (obj);    if (! id) return MIME_OUT_OF_MEMORY;        if (obj->options && obj->options->url)    {      const char *url = obj->options->url;      if (id_imap && id)      {        /* if this is an IMAP part. */        id_url = mime_set_url_imap_part(url, id_imap, id);      }      else      {        /* This is just a normal MIME part as usual. */        id_url = mime_set_url_part(url, id, PR_TRUE);      }      if (!id_url)      {        PR_Free(id);        return MIME_OUT_OF_MEMORY;      }    }        if (!PL_strcmp (id, "0"))    {      PR_Free(id);      id = MimeGetStringByID(MIME_MSG_ATTACHMENT);    }    else    {      const char *p = "Part ";  /* #### i18n */      char *s = (char *)PR_MALLOC(PL_strlen(p) + PL_strlen(id) + 1);      if (!s)      {        PR_Free(id);        PR_Free(id_url);        return MIME_OUT_OF_MEMORY;      }      /* we have a valid id */      if (id)        id_name = mime_find_suggested_name_of_part(id, obj);      PL_strcpy(s, p);      PL_strcat(s, id);      PR_Free(id);      id = s;    }        if (all_headers_p &&    /* Don't bother showing all headers on this part if it's the only    part in the message: in that case, we've already shown these    headers. */    obj->options->state &&    obj->options->state->root == obj->parent)    all_headers_p = PR_FALSE;        newopt.fancy_headers_p = PR_TRUE;    newopt.headers = (all_headers_p ? MimeHeadersAll : MimeHeadersSome);        {      char p[] = "<P>";      status = MimeObject_write(obj, p, 3, PR_FALSE);      if (status < 0) goto FAIL;    }        status = MimeHeaders_write_attachment_box (obj->headers, &newopt,                                                obj->content_type,                                                obj->encoding,                                                id_name? id_name : id, id_url, 0);    PR_FREEIF(id_name);    if (status < 0) goto FAIL;        {      char p[] = "<P>";      status = MimeObject_write(obj, p, 3, PR_FALSE);      if (status < 0) goto FAIL;    }    FAIL:    PR_FREEIF(id);    PR_FREEIF(id_url);    PR_FREEIF(id_name);    if (status < 0) return status;  }  #ifdef XP_MACdone:#endif /* XP_MAC */    return 0;}