Re: [CODE][NEWBIE][HELP]

From: Adam Pate (apate@cesales.com)
Date: 02/18/99


I figured out the problem with saving aliases crashing the mud with
circle30bpl14.  This pertains to using the alias patch from the circle ftp
site.

This was the call that was crashing the mud when I would save the alias

get_filename(GET_NAME(ch), pcFileName, ALIAS_FILE);  <-- From alias.c

In get_filename (utils.c)

const char *prefix, *middle, *suffix;
  char name[64], *ptr;

  switch (mode) {
  case CRASH_FILE:
    prefix = LIB_PLROBJS;
    suffix = SUF_OBJS;
    break;
  case ETEXT_FILE:
    prefix = LIB_PLRTEXT;
    suffix = SUF_TEXT;
    break;
  case ALIAS_FILE:
        prefix = "PLRALIAS"; <====== This should be - prefix="PLRALIAS/"
        suffix = "alias";
        break;

One little slash was the culprit.  I didn't catch this because the other 2
cases Crash_file and Etext_file are defined in db.h.  It was there that I
found the the directories must have slashes.  This obviously wasn't the case
in earlier versions of circle.

Thanks to all who helped me get to the bottom of this.


-----Original Message-----
From: Thomas Pedersen <classic@westnet.com>
To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
Date: Thursday, February 18, 1999 3:50 PM
Subject: Re:  [CODE][NEWBIE][HELP]


>I've had a similar problem once with alias (user specific), and it turned
>out to be a corrupt alias file.
>
>On Thu, 18 Feb 1999, Adam Pate wrote:
>
>> I know the aliases I have used to test this are less than 127 and it
still
>> crashes.  Plain and simple, if you have an alias and you type save, the
mud
>> dies.  I can't figure it out.   :(
>> Does anyone out there have some alias code that patches cleanly with
>> circle30bpl14???? Or maybe a fix for this situation?
>>
>> -----Original Message-----
>> From: Acido <acido@DVMUD.NET>
>> To: CIRCLE@post.queensu.ca <CIRCLE@post.queensu.ca>
>> Date: Thursday, February 18, 1999 11:16 AM
>> Subject: Re:  [CODE][NEWBIE][HELP]
>>
>>
>> >At 09:56 AM 2/18/99 -0500, you wrote:
>> >
>> ><SNIP>
>> >>void write_aliases(struct char_data *ch)
>> >>{
>> >>  FILE *file;
>> >>  char fn[127],*buf;
>> >The above line is bad :) it causes your mud to crash if the alias is
longer
>> >than 127 chars.
>> >
>> >
>> >     +------------------------------------------------------------+
>> >     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>> >     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>> >     +------------------------------------------------------------+


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



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