Commit b61414de authored by rswindell's avatar rswindell
Browse files

Fixed 12-year old bug (introduced in rev 1.10):

getusrsub() returned the completely wrong sub-board number. It assumed that
getusrgrp() returned a 0-based index when in fact it returns a 1-based group
number. This bug was only visible when using certain @-codes (e.g. "SN",
"SL", "SR", and "SMB_SUB_NUM") when a sub-board was open via Synchronet
internal function (i.e. not via JS MsgBase class). If the current group was the
last group visible to the user, this would cause a crash.
parent c66fe912
...@@ -742,7 +742,7 @@ uint sbbs_t::getusrsub(uint subnum) ...@@ -742,7 +742,7 @@ uint sbbs_t::getusrsub(uint subnum)
ugrp = getusrgrp(subnum); ugrp = getusrgrp(subnum);
if(ugrp<=0) if(ugrp<=0)
return(0); return(0);
ugrp--;
for(usub=0;usub<usrsubs[ugrp];usub++) for(usub=0;usub<usrsubs[ugrp];usub++)
if(usrsub[ugrp][usub]==subnum) if(usrsub[ugrp][usub]==subnum)
break; break;
......
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