Re: [GDB] help with output

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


On Wed, 7 Jan 1998, Demond LaZaro wrote:

Deja Vu, I just did something like this. :)

>  char buf[MAX_STRING_LENGTH];

You have that right this time.

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

What is MAX_CLAN and why are you not using 'i' for your accesses?
The way you have it you'll access the same variable every time, and you
forgot to append the string onto itself.  You'll just keep overwriting the
string until you get to the last one.

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

>I'd be greatful if someone could tell me what was going on??

Those errors were really easy to spot, I'm sure a little more work and you
could have found them without trouble.

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