[Code] [Stock bug?] write_to_ouput oops. :-)

From: John Woods (JWoodsIII@AOL.COM)
Date: 07/15/98


While fixing some game-crashing bugs, I came across this in write_to_output.
It was the source of a crash, and quite annoying. Couldn't create characters,
as SEND_TO_Q uses write_to_output. It only messed up, however, at the call for
it in CON_QSEX in nanny(). So I went back and copied the function directly out
of my stock source, and replaced the entire thing in my code. It gave me the
same problems. So I isolated the problem to this line:
    CREATE(t->large_outbuf->text, char, LARGE_BUFSIZE);
Then I looked at it again, and realized that it was using "char" in there.
That's not even a variable in the function. Looks like a bug. Anyone tell me
if I'm right or wrong?

Here's the actual code. it stopped just after "JW: 6-2b" in the logs.
  if (bufpool != NULL) {
    log("JW: 6-1");
    t->large_outbuf = bufpool;
    bufpool = bufpool->next;
  } else {                      /* else create a new one */
    log("JW: 6-2");
    CREATE(t->large_outbuf, struct txt_block, 1);
    log("JW: 6-2b");
    CREATE(t->large_outbuf->text, char, LARGE_BUFSIZE); <==here
    log("JW: 6-2c");
    buf_largecount++;
    log("JW:6-2d");
  }

Thanx,
-Elrelet


     +------------------------------------------------------------+
     | 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/15/00 PST