Re: [CODE][ERRORS]Clan.c

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


On Wed, 7 Jan 1998, Demond LaZaro wrote:

>ACMD(do_complist)
>{
>  int i;
>  char buf[10];

This overrides the global 8k 'buf' variable.

>
>  for (i = 1; i < MAX_CLAN; i++) {
>    sprintf(buf, "%s Company\r\n", clan[MAX_CLAN].clan_name);
>  }

You're skipping array element 0, you never send the result to anywhere, and
you're putting all that in a 10 character buffer!  Not good. :)

>  sprintf(buf, "%sThanxs for useing Company Directorys.\r\nUser %s\r\n",
                                ^using
>        buf, GET_NAME(ch));
>  sprintf(buf, "%sDisconected.....\r\n", buf);
                         ^n
>  send_to_char(buf, ch);

And in this context, buf = 10 letters.  Might fix your problem just by
deleting the 'buf[10]' line.

--
George Greer  -  Me@Null.net   | Genius may have its limitations, but stupidity
http://www.van.ml.org/~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/15/00 PST