Re: [ Code ] My previous post...

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 07/31/97


On Thu, 31 Jul 1997, Ron Cole wrote:

>I think a macro was used, so if you do the following, it'll break:
>
>if (test)
>  FREE(ch);

Right, try do { } while (0);

>void *my_free(void *ch)
>{
>  free(ch);
>  return ch = NULL;
>}
>
>Then change all your free calls to:
>
>ch = my_free(ch);

Too much work, refer to my other mail forthcoming.
It's : do { free((ptr)); (ptr) = NULL; } while (0);

--
greerga@muohio.edu me@null.net | Genius may have its limitations, but stupidity
http://www.muohio.edu/~greerga | is not thus handicapped. -- 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/08/00 PST