Commit 79ab9176 authored by rswindell's avatar rswindell
Browse files

smb_getmsgtxt() now retrieves comment header fields as part of msg text.

parent 30a2ed07
......@@ -51,6 +51,7 @@ char* SMBCALL smb_getmsgtxt(smb_t* smb, smbmsg_t* msg, ulong mode)
char* buf;
char* lzhbuf;
char* p;
char* str;
ushort xlat;
uint i;
int lzh; /* BOOL */
......@@ -64,6 +65,21 @@ char* SMBCALL smb_getmsgtxt(smb_t* smb, smbmsg_t* msg, ulong mode)
}
*buf=0;
for(i=0;i<msg->total_hfields;i++) { /* comment headers are part of text */
if(msg->hfield[i].type!=SMB_COMMENT && msg->hfield[i].type!=SMTPSYSMSG)
continue;
str=(char*)msg->hfield_dat[i];
length=strlen(str)+2; /* +2 for crlf */
if((p=(char*)REALLOC(buf,l+length+1))==NULL) {
sprintf(smb->last_error
,"realloc failure of %ld bytes for comment buffer"
,l+length+1);
return(buf);
}
buf=p;
l+=sprintf(buf+l,"%s\r\n",str);
}
for(i=0;i<msg->hdr.total_dfields;i++) {
if(msg->dfield[i].length<=sizeof(xlat))
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment