Re: minor bug

From: George Greer (greerga@circlemud.org)
Date: 07/02/01


On Fri, 29 Jun 2001, Patrick Dughi wrote:

>where - as should be obvious to anyone, buf2 is supposed to be the
>filename (as per intial setup, discrete_load arguments, etc).  However,
>since it's a global buffer instead of a local copy, and buf2 is used
>in those functions (generally as the error message for fread_string in
>parse_room, and others), it's only valid the first time through.

Yep, appears true. You'll lose 'filename' if it's written to.

>        Lucky for us, it appears to never be used.
>
>        Unlucky for me, because I actually was using it, and it took a
>while to nail down the error.  As a general rule, we probably shouldn't be
>passing pointers to global character strings around as arguments, to,
>well... anything?

-Wshadow and I are going to get really friendly some day to eliminate the
global buffers.  Until then it's a case of being aware of what is used
where.

Hey, maybe I could use my old get_buffers() patch... :)

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | 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/06/01 PST