Re: [Circle] Show zones bug

From: Rasmus 'Con' Ronlev (raro94ab@hp4.econ.cbs.dk)
Date: 08/09/96


On Mon, 5 Aug 1996, John C. A. Bambenek, Esq. wrote:

> Guess what? Did the page buffer thing on it, and it still crashes when I
> type show zones, I get no error messages, no core dump, I just don't get it.

Hehe, It's a problem you're unavare off unless you accidentially stumble
across it. The problem is, that you're most probably exceeding the
buffersize of the buffer you're using. I calculated the buf to be able to
take 4 pages of 'full screen info' without colors, less with, and some
more if you don't use all 80*24 chars ona screen.

You need to go into do_show and make a NEW buffer let's say... buff (two
f's :) thats bigger, like char buff[32000];  or to make sure you don't
exceed the size of buf when showing zones..
you could do it using this kind of check:

  if (strlen(buf) + 50 > sizeof(buf))

The 50 I add to the strlen is what I recon a line will use, you might want
to change it to 100 if the mud still crashes. If the IF statement is
'evaluated as beeing true' you have a problem. This means you're close to
exceeding the size of buf. Invent some way of handling the error :)

Regards,
Con.

d.
--
     Rasmus Rønlev DOEK'94      WWW: http://www.econ.cbs.dk/people/raro94ab
     Student instructor         MUD: exiled.mud.circlemud.org 5000
                                         199.199.16.100 5000
       Student, B.Sc in Computer Science and Business Administration.

+-----------------------------------------------------------+
| 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/07/00 PST