Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!nntp-out.monmouth.com!newspeer.monmouth.com!cpk-news-hub1.bbnplanet.com!denver-snf1.gtei.net!news.gtei.net!coop.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: [inform] oh my rotting code
Message-ID: <G46IvI.4E0@world.std.com>
Date: Fri, 17 Nov 2000 17:21:18 GMT
Organization: The World Public Access UNIX, Brookline, MA
Lines: 37
Xref: news.duke.edu rec.arts.int-fiction:80573

I just recompiled and reran some code from a game I had
been working on six months ago, and am totally puzzled
by a strange bug in the hint system which I'm certain
wasn't there six months ago.

I'm using a modified version of Inform 6.21 and library 6/9,
so it's not something anybody else is going to be able to
repro, but if I compile with strict mode and run the same
version of winfrotz I had back then, I get the following error
in the hint menu:

[** Programming error: tried to write to -->0 in the (->) string array "
[** Programming error: tried to print (string) on something not a string **]
.......obscured.text......... 128 **]

where I'm guessing the nested error amounts to
"tried to write to -->0 on something not a string".

I eventually bracketed the bug using read_char, and
tracked it down to the following bit of code in utility.h:

   Array CenterText string 128;
   ...snip...
   [ CenterU instring j i;
       CenterText-->0 = 128;

Can anybody give me some kind of clue under what condition
the above code would produce the aforementioned error, and what
I can do to correct it? I don't mind hacking on the library or
these files, I just have no clue what to conclude having
tracked it down.  (Nor do I have any clue why it used to work;
hopefully the one will shed light on the other.)

Hmm, and when I ran it this time to copy down the error
text, winfrotz crashed on exit.  Huh.

SeanB
