Skip to content
Snippets Groups Projects
Commit 64bbd8bd authored by rswindell's avatar rswindell
Browse files

Fix bug in previous commit: msg.idx is not initialized at this point.

parent 2f8557de
No related branches found
No related tags found
No related merge requests found
......@@ -637,23 +637,24 @@ int sbbs_t::scanposts(uint subnum, long mode, const char *find)
subscan[subnum].ptr=post[smb.curmsg].number;
}
if(sub_op(subnum) && (msg.idx.attr&(MSG_MODERATED|MSG_VALIDATED)) == MSG_MODERATED) {
if(sub_op(subnum) && (msg.hdr.attr&(MSG_MODERATED|MSG_VALIDATED)) == MSG_MODERATED) {
uint16_t msg_attr = msg.hdr.attr;
SAFEPRINTF2(str,text[ValidatePostQ],msg.hdr.number,msg.subj);
if(!noyes(str))
msg.idx.attr|=MSG_VALIDATED;
msg.hdr.attr|=MSG_VALIDATED;
else {
SAFEPRINTF2(str,text[DeletePostQ],msg.hdr.number,msg.subj);
if(yesno(str))
msg.idx.attr|=MSG_DELETE;
msg.hdr.attr|=MSG_DELETE;
}
if(msg.idx.attr!=msg.hdr.attr) {
if(msg_attr!=msg.hdr.attr) {
if(msg.total_hfields)
smb_freemsgmem(&msg);
msg.total_hfields=0;
msg.idx.offset=0;
if(!smb_locksmbhdr(&smb)) { /* Lock the entire base */
if(loadmsg(&msg,msg.idx.number)) {
msg.hdr.attr=msg.idx.attr;
msg.hdr.attr=msg.idx.attr=msg_attr;
if((i=smb_putmsg(&smb,&msg))!=0)
errormsg(WHERE,ERR_WRITE,smb.file,i,smb.last_error);
smb_unlockmsghdr(&smb,&msg);
......
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