Re: hmmm.... db.c:free_char()

From: George (greerga@CIRCLEMUD.ORG)
Date: 08/07/98


On Fri, 7 Aug 1998, Stephen Wolfe wrote:

>since everyone explained why it wouldn't work, but didn't provide a
>solution, here's one..just make a macro like:
>
>#define FREE(var)       do {            \
>                          free(var);    \
>                          var = NULL;   \
>                        } while (0)
>
>and replace all free() calls with FREE()..

Won't work for his purpose, for free_char() to NULL all pointers to the
character.  That will work for references to that variable later in the
function though. (I do the same thing in my buffer patch.)

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://mouse.van.ml.org/ (not done) | 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