diff --git a/src/sbbs3/postmsg.cpp b/src/sbbs3/postmsg.cpp index 0f621086d0af075efef4e4e39ac40c0b466cf775..83eef670167a1995c286724d9469703d1328e249 100644 --- a/src/sbbs3/postmsg.cpp +++ b/src/sbbs3/postmsg.cpp @@ -67,6 +67,7 @@ static uchar* findsig(char* msgbuf) bool sbbs_t::postmsg(int subnum, int wm_mode, smb_t* resmb, smbmsg_t* remsg) { char str[256]; + char fmt[256]; char title[LEN_TITLE+1] = ""; char top[256] = ""; char touser[64] = ""; @@ -107,7 +108,8 @@ bool sbbs_t::postmsg(int subnum, int wm_mode, smb_t* resmb, smbmsg_t* remsg) if(remsg->to != NULL) strListPush(&names, remsg->to); msgattr=(ushort)(remsg->hdr.attr&MSG_PRIVATE); - sprintf(top,text[RegardingByToOn] + expand_atcodes(text[RegardingByToOn], fmt, sizeof fmt); + snprintf(top, sizeof top, fmt ,title ,from ,msghdr_field(remsg, remsg->to, NULL, term_supports(UTF8)) diff --git a/src/sbbs3/readmail.cpp b/src/sbbs3/readmail.cpp index f148bb6dbbed15b8b239eae21692c53ae8b6dbff..b45dfe588519f6dc1641faa7e1c6b67816782076 100644 --- a/src/sbbs3/readmail.cpp +++ b/src/sbbs3/readmail.cpp @@ -43,6 +43,7 @@ int sbbs_t::readmail(uint usernumber, int which, int lm_mode) { char str[256],str2[256],done=0,domsg=1 ,*p; + char fmt[256]; char tmp[512]; int i; uint32_t u,v; @@ -344,10 +345,11 @@ int sbbs_t::readmail(uint usernumber, int which, int lm_mode) smb_getmsgidx(&smb,&msg); if(!stricmp(str2,str)) /* Reply to sender */ - SAFEPRINTF(str2,text[Regarding], msghdr_field(&msg, msg.subj)); + expand_atcodes(text[Regarding], fmt, sizeof fmt); else /* Reply to other */ - SAFEPRINTF3(str2,text[RegardingByOn], msghdr_field(&msg, msg.subj), msghdr_field(&msg, msg.from, tmp) - ,timestr(msg.hdr.when_written.time)); + expand_atcodes(text[RegardingByOn], fmt, sizeof fmt); + SAFEPRINTF3(str2, fmt, msghdr_field(&msg, msg.subj), msghdr_field(&msg, msg.from, tmp) + ,timestr(msg.hdr.when_written.time)); p=strrchr(str,'@'); if(p) { /* name @addr */ diff --git a/src/sbbs3/readmsgs.cpp b/src/sbbs3/readmsgs.cpp index 1067f6f34c849e8cd932337fb768d61d45f68274..a5753feeefae295cba19629906e413167e1028bd 100644 --- a/src/sbbs3/readmsgs.cpp +++ b/src/sbbs3/readmsgs.cpp @@ -396,6 +396,7 @@ int sbbs_t::scanposts(int subnum, int mode, const char *find) { char str[256],str2[256],do_find=true,mismatches=0 ,done=0,domsg=1,*buf; + char fmt[256]; char find_buf[128]; char tmp[128]; int i; @@ -1006,7 +1007,8 @@ int sbbs_t::scanposts(int subnum, int mode, const char *find) && stricmp(msg.to,useron.name) && stricmp(msg.to,useron.alias)) break; - SAFEPRINTF2(str2,text[Regarding] + expand_atcodes(text[Regarding], fmt, sizeof fmt); + SAFEPRINTF2(str2, fmt ,msghdr_field(&msg, msg.subj) ,timestr(msg.hdr.when_written.time)); if(msg.from_net.addr==NULL)