• src/sbbs3/data.cpp sbbs.h

    From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Wed Jan 24 18:03:44 2024
    https://gitlab.synchro.net/main/sbbs/-/commit/1ea66f5b309e7d806dea46cb
    Modified Files:
    src/sbbs3/data.cpp sbbs.h
    Log Message:
    Don't store pointer to stack variable in sbbs_t::event_code

    sbbs_t::gettimeleft() was storing a pointer to a stack (temporary/local) variable containing a copy of the next exclusive event cfg (including its internal code). This variable, including the internal code, is invalid when
    it goes out of scope. This change makes the sbbs_t::event_code point to the sbbs_t::cfg.event[]->code (on the heap) instead.

    The only use of this event_code (outside of the event_thread), appears to be
    in the JS bbs.event_code property string. So this fixes issue #705. No other observed side effect from this bug.

    Constified getnexteventtime() while here. No functional impact.
    --- SBBSecho 3.20-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)