[Lurking Mode Off]

Can anyone help me with a very strange problem I am having? Basically, my code looks like:

bool get_flag( int index )
{
        bool ret_val = FALSE;
        if( acct_flags )                                       ***
                ret_val = acct_flags->bit[ index ];

        return ret_val;
}

(acct_flags is a pointer to a structure).
However, when this function is run, the mud crashes at the line marked *** with a segmentation fault. Now, I would expect a crash on the next line (when it tried to find whatever acct_flags was pointing at), but I can replace the line "ret_val = acct_flags etc etc" with a simple printf, and the function still crashes. However, if I replace "acct_flags" in the line from hell with "0" the function executes perfectly. Any suggestions?

T.H.C.

[Lurking Mode On]


Reply via email to