Re: if (blah) ...

From: Zeavon (zeavon@kilnar.com)
Date: 08/11/99


> >It certainly _is_.  No-one ever thinks it's their code
> that's broken, but
> >it is 99.9999999998% of the time.  You've screwed up your linked list
> >somewhere and maybe a few other pointers elsewhere.  Perhaps
> you have a
> >memory overrun.
>
> Then why would if (blah) cause problems where if (blah !=
> NULL) does not?
>
> Surely if blah is not equal to NULL and if's behaviour is as
> specified they
> should be functionally identical. They are certainly not in
> this particular
> case.

This has already been said, but perhaps you missed that email or just
ignored what it had to say.

if (blah)
and
if (blah != NULL)

are NOT identical in their functionality! If you have an item that you
free() it is not explicity set to NULL. Also, if you write a piece of code
that overflows into other memory that it shouldn't, then you can trash data.
That means that accessing d->character could cause serious problems of
d->character has been trashed with some other data.

I would undo your latest changes or use gdb and see what your memory looks
like at the time of crash.

I can garuntee you that it's not stock code. If it was, then we would all be
having the same problem that you are having.

--
Zeavon Calatin, Spear of Insanity
spear.kilnar.com:1066
http://spear.kilnar.com/


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



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