Skip to content
Snippets Groups Projects
Commit 68f7c24c authored by rswindell's avatar rswindell
Browse files

strip trailing white-space off the end of printed messages *after* they're word

wrapped. Pass the column width to wordwrap() instead of columns-1.
parent 18edb652
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,6 @@ void sbbs_t::show_msg(smbmsg_t* msg, long mode)
show_msghdr(msg);
if((text=smb_getmsgtxt(&smb,msg,GETMSGTXT_ALL))!=NULL) {
truncsp_lines(text);
putmsg(text, mode|P_WORDWRAP);
smb_freemsgtxt(text);
}
......
......@@ -67,10 +67,12 @@ char sbbs_t::putmsg(const char *buf, long mode)
putcom("\x02\x02");
if(mode&P_WORDWRAP) {
char *wrapped;
if((wrapped=::wordwrap((char*)buf, cols-1, 79, WORDWRAP_FLAG_QUOTES)) == NULL)
if((wrapped=::wordwrap((char*)buf, cols, 79, WORDWRAP_FLAG_QUOTES)) == NULL)
errormsg(WHERE,ERR_ALLOC,"wordwrap buffer",0);
else
else {
truncsp_lines(wrapped);
str=wrapped;
}
}
while(str[l] && (mode&P_NOABORT || !msgabort()) && online) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment