Re: [code] FREE !!!

From: Rasmus 'Con' Ronlev (
Date: 12/19/96

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
> When ever I get a whois on someone its not freed so when I type whois
> again it gives me both enteries... then three...
> ACMD(do_whois)

>       sprintf(buf, "%s\\c07Level \\c04%d %s\\c07.\\c00\r\n", buf,
                     ^^^^                                     ^^^^^^
> GET_LEVEL(victim),
>               class_abbrevs[(int) GET_CLASS(victim)]);

Well, there's your problem, underlined with ^'s :)
You're copying your old buffer along with the new output...
Actually you'll get what was put last in buf, and add the new info to

So, just make it:

sptintf(buf, "\\c07Level \\c04%d %s \\c07.\\c00\r\n," GET_LEVEL(victim),
             class_abbrevs[(int) GET_CLASS(victim)]);

Hope this helps :)

     Rasmus Rønlev DOEK'94      WWW:
     Student instructor         MUD: 5000
       Student, B.Sc in Computer Science and Business Administration.

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

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