Re: if (blah) ...

From: Peter Ajamian (
Date: 08/20/99

"Daniel A. Koepke" wrote:

> Today, Peter Ajamian spake to the list:
> > Ceartainly there are several places where it frees memory, then sets
> > the pointer to null, but where does it then turn around and base an if
> > statement on the value of the pointer which was just set to null as in
> > the following line from above...?
> Well, back in nanny() again, you see:
>     if (d->character == NULL) {
>         CREATE(d->character, struct char_data, 1);
>         clear_char(d->character);
>         ...
>     }

I asked for an example of where a pointer was set to null and then it's value
used in an if statement directly following, this example shows the if
statement, but not the pointer being set to null directly ahead of it.

> in CON_GET_NAME.  Also,
>     if (d->character->player.description) {
>         SEND_TO_Q("Old description:\r\n", d);
>         ...
>     }

> in case '2' of CON_MENU.

Same as above.

> Also, as George noted, there's an instance in

> Valid_Name().

Yes, and I will give him credit for finding it even though it is not exactly
what I was asking for.

> Are you sure you really looked?!  I wasn't hallucinating or
> making up stuff.

Yes, I REALLY looked (duh!).  I did a search for the word "free" in the nanny
function and did not find any instance which seems to correlate with the
psudocode posted by Chris Proctor.  There are some examples which correlate to
part of the psudocode, and the example posted by George, but that's about as
close as it gets.



     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  |

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