Helpfile loading & spiffy hack ,-)

From: Rasmus Ronlev (raro94ab@STUDENT.ECON.CBS.DK)
Date: 11/01/97


I got inspired by the recent post about someone having made a helpfile
editor. I thought I'd take a peek at it, but decided, that it couldn't
offer what I wanted, so I started poking arround in the code.

Since I've modified it once, in the beginning I thought I'd made an error,
but it seems, that comparing the code I have in my mud, with the bpl12
code, that there is a possible memory overflow in loading helpfiles.

In db.c when the helpfiles are being assinged space, this is done once
with the following CREATE call in index_boot:

  case DB_BOOT_HLP:
    CREATE(help_table, struct help_index_element, rec_count * 2);

Then in the load_help() function, the helptable entries are simply being
read into the created space. The created space is twice the size of
counted 'hashes' in the helpfile, but that's about it...

So, if the helpfile has more than two keywords per help entry in average,
there will be a boom-boom crash :p

I haven't quite decided what to do about this yet, but I just felt I'd let
you all know, and sugest to Jeremy, that this might be something that
could be fixed up, so instead the number of keywords would be counted.. ?

I realize this would impose making a seperate procedure to count the
number of keywords in all the help files, and that the decentralized
'index file' idea, for splitting the helpfiles up in multiple files (or at
least making it possible) might have been the idea for putting the loading
of the help table there, but... anyway... :) It's a sugestion for
something to change/fix for bpl13+ *grin*

Furhtermore it would possible save a few bytes of memory... Not that it'd
be too much. There's a danish saying though: 'Many drops make a creek' :)

If I end up with an own solution, that loads the helpfiles in the above
sugested way, I'll try and post it to the list, so you might use it, but I
might just end up with some wierd code, since I'm changing the format of
the help file also.

Rand (Ain't Con anymore :)

        Rasmus Ronlev DOEK'94 

              B.Sc. Computer Science and Business Administration
          Stud. M.Sc. Computer Science and Business Administration

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

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