Re: [CODE] Events - My ch pointer has been violated! :)

From: George (greerga@CIRCLEMUD.ORG)
Date: 05/06/98


On Wed, 6 May 1998, Chuck Reed wrote:

>void call_timed_dt(struct char_data *ch)
>{
>   struct death_trap_type *dt;
>
>   CREATE(dt, struct death_trap_type, 1);
>   dt->ch = ch;
>   GET_TIMED_DT(ch) = event_create(timed_dt, dt, 4);
>
>}

CREATE() will zero out the 'dt' structure.

Trying to take 'dt->ch' will give you your NULL reference.

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://patches.van.ml.org/          | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST