Re: [ASCII PFILE] Malloc

From: Sammy (samedi@ticnet.com)
Date: 03/03/01


On Fri, 2 Mar 2001 13:54:35 EST, Jory Graham wrote:

>ok, i have the server downloaded from the ftp site that has the ascii
>pfiles, assemblies, oasis, dg, etc... for bpl17 installed.  I think it was
>the one uploaded by Del.  Anyway, i'm running win98 with MSCVC 4.0, did the
>_fileno fix, and still crash on character creation right after selecting a
>class.  I wnet thru marking the code, and got down to the line:

Good job with that.  The same problem took me forever using GDB.

>if(!(tname = malloc(strlen(fbfl->name) + 5)))
>    return 0;

Make that + 6, one extra for the null termination.  There are a couple
other spots where you 'll have to do the same thing.  I don't have
them on hand, but you can upgrade to the most recent diskio.c by
getting version 2.1 of the ascii pfiles from ftp.circlemud.org.

Thanks for bringing this code to my attention.  The + 6 thing was a
quick fix, but I forgot that I was supposed to remove those numbers
completely and use a more readable constant.

Sam

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST