Another silly question (thanks Bobby for solving my last one!!)...

I'm getting a Seg Fault in the following code:

if (!IS_NPC(ch))
{
    for (i=ch->in_room->track_num; i <= MAX_TRACK_INROOM; i++)
    {
        if (i == ch->in_room->track_num)
        {
         ch->in_room->track[i]->name = ch->name;    /* <--- THIS LINE */
                ch->in_room->track[i]->dir  = door;
                ch->in_room->track[i]->timer = timer;

                     if (ch->in_room->track_num >= MAX_TRACK_INROOM)
                     {
                         ch->in_room->track_num = 0;
                     }
                     else
                     {
                         ch->in_room->track_num += 1;
                     }
        }
    }
}

According to GDB, ch->in_room->track[i]->name = ch->name; is the line
causing the fault.

I don't really understand -- if both are set to char *, why can't I set one
to the
other? How would I go about accomplishing this? Will I have the same problem
with the integers door and timer?

Thanks!
-Cameron


Reply via email to