Re: [bug]Object file saving

From: George (greerga@DRAGON.HAM.MUOHIO.EDU)
Date: 08/11/97


On Mon, 11 Aug 1997, Andy Hubbard wrote:

>It is infact a bug in the buffer patch v0.9.

Drat, I hate those. :)

>+  release_buffer(name);
>   sprintf(filename, "%s/%s/%s.%s", prefix, middle, name, suffix);
>   return 1;
> }
>
>seems to clear the 'name' part of the filename before it is written!
>Resulting in a blank object file, and later I discover blank.alias
>files!  .. makes sense!

Yep, release_buffer() is paranoid and instantly NULL's the buffer.

>Just release the buffer AFTER the sprintf and all is OK again!

I've fixed that in my current source tree, I recommend everyone else does
too. :)

>I've just checked v1.0 of the patch and it is the same ... so I hope
>George sees this!

Yes, but then again, 1.0 was a mistake because I erased 0.9 on accident. :)

>ps. this patch rox and solved my malloc errors .. thanx George!

No problem.  I'm currently going through every single function in CircleMUD
trying to wean them off the static buffers and onto the buffer system.
It's a pain in the butt but I think it's worth it.

--
greerga@muohio.edu me@null.net | Genius may have its limitations, but stupidity
http://www.muohio.edu/~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/08/00 PST