Re: str_dup, CREATE(), et al [fixed]

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 03/18/98


Well, I finally got some time to work on it, and guess what?!
Thanks, it solved my problem perfectly.  I wasn't sure it was going to work,
but I tried it and ran the players command over and over,
and I guess it must have been the problem with allocating the memory
for the entire char_data structure that was causing problems.

Thanks, it worked.  I did hafta add a free_char_strings() function
though to be sure there were no memory leaks.  All the function does
is the same as free_char() minus the last  "if (ch) free(ch);"

I can't stress "Thanks" enough for your help.

ObCircle:
Btw, people. If anyone has seen my CircleMUD snippet page yet,
they know I only have 3 snippets.  Soon, I will be de-hacking my code
to bring out new stuff, but so far, I finally added the
Ispell snippet to my page (it is mine anyway :-P)  and changed
a few things around to make it more readable, and less like an
E-mail.  It also has information that you need to know, if you
plan on using it (like "You must have Ispell installed on the
  machine for this to work." and "If you don't have send_to_charf(),
either use sprintf()'s and send_to_char()s separately, or get it."

Anyway, l8r

Code On
Akuma the Raging Coder

At 10:07 PM 3/16/98 -0500, George Greer wrote:
>
>Ah ok, in that case, the best thing to do is this:
>
>struct char_data chst;
>
>for (...) {
>  load_char(&chst);
>  ...doo stuff...
>}
>
>Then you don't have to worry about free/malloc.
>

  +------------------------------------------------------------+
  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |
  +------------------------------------------------------------+


     +------------------------------------------------------------+
     | 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