Re: [code] FREE !!!

From: Brian Williams - Nashak (bmw@efn.org)
Date: 12/18/96


hrm... well, you gotta put in a *buf = '\0'; or whatever at the top of the
function
On Wed, 18 Dec 1996, Allan M. Grant wrote:

> I have just set up a whois patch from the site and I got a bug that
> really.. ReAlLy... REALLY... R E A L L Y . . . pisses me off!
> Sorry :)
> When ever I get a whois on someone its not freed so when I type whois
> again it gives me both enteries... then three...
> >whois Pheonix
> Level 54 pa.
> 
> >whois Hades
> Level 54 pa.
> Level 53 mu.
> 
> >whois Pheonix
> 
> Level 54 pa.
> Level 53 mu.
> Level 54 pa.
> 
> See? I have a free command but I guess I am not freeing enough or
> freeing the wrong thing. Here is the code:
> 
> ACMD(do_whois)
> {
>   struct char_data *victim = 0;
>   struct char_file_u tmp_store;
    *buf = '\0';
> 
>   skip_spaces(&argument);
> 
>   if (!*argument) {
>     send_to_char("\\c07USAGE: whois \\c04<name of a player to get info
> on>\\c00\r\n", ch);
>   }
>   else {
>     CREATE(victim, struct char_data, 1);
>     clear_char(victim);
>     if (load_char(argument, &tmp_store) > -1) {
>       store_to_char(&tmp_store, victim);
>       sprintf(buf, "%s\\c07Level \\c04%d %s\\c07.\\c00\r\n", buf,
> GET_LEVEL(victim),
>               class_abbrevs[(int) GET_CLASS(victim)]);
>       send_to_char(buf, ch);
>     }
>     else {
>       send_to_char("There is no such player.\r\n", ch);
>     }
>   }
> free(victim);
> }
> 
> Hope you can help me. I am REALLY desperate and I bet its something
> REALLY simple... Well anyway.. thanks.
> 
> 
> Pheonix the Newbie Implementor Who Wants to Learn
> +-----------------------------------------------------------+
> | Ensure that you have read the CircleMUD Mailing List FAQ: |
> |   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
> +-----------------------------------------------------------+
> 

        /---------\      /--------/
       / /XXXXXXX\ \    / ////// /
      / ///XXXXX\\\ \  / ////// /
     / /////XXX\\\\\ \/ ////// /    -=-=-=-=-=-=-=-
    / //////  \\\\\\\  ////// /    Brian Williams
   / ////// /\ \\\\\XXX///// /    bmw@efn.org
  / ////// /  \ \\\XXXXX/// /
 / ////// /    \ \XXXXXXX/ / /\  /_ |_|  /\  |/
/--------/      \---------/ /--\  / | | /--\ |\

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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