Skip to content
Snippets Groups Projects
Commit 3b1f8928 authored by rswindell's avatar rswindell
Browse files

savemsg() now truncates white-space off the end of the message text, thus the

stored message text may be less than the string length of msgbuf.
parent feefe85d
Branches
Tags
No related merge requests found
...@@ -465,9 +465,13 @@ extern "C" int DLLCALL savemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, char* msg ...@@ -465,9 +465,13 @@ extern "C" int DLLCALL savemsg(scfg_t* cfg, smb_t* smb, smbmsg_t* msg, char* msg
} }
length=strlen(msgbuf); length=strlen(msgbuf);
/* Remove white-space from end of message text */
while(length && (uchar)msgbuf[length-1]<=' ')
length--;
/* Calculate CRC-32 of message text (before encoding, if any) */ /* Calculate CRC-32 of message text (before encoding, if any) */
if(smb->status.max_crcs) { if(smb->status.max_crcs) {
for(l=0;msgbuf[l];l++) for(l=0;l<length;l++)
crc=ucrc32(msgbuf[l],crc); crc=ucrc32(msgbuf[l],crc);
crc=~crc; crc=~crc;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment