Custom Prompt

From: Ryan (
Date: 04/01/95

Hi there, I'm trying to complete a custom prompt system where people may 
choose their own prompt style, and what they would like to see in it.

However, there seems to be a critical bug somewhere in my procedure, but 
I cannot locate it.

here's what the code looks like at the moment..

void make_prompt(struct descriptor_data * d)

  register char *i, *buff;
  static char lbuff[MAX_STRING_LENGTH];
  char *prompt;

  if (d->str)
    write_to_descriptor(d->descriptor, "] ");
  else if (d->showstr_point)
			"\r\nPress Enter to continue:");
  else if (!d->connected) {

    sprintf(prompt, "< &N > "); /* this is where the procedure would normally
                                   read the character's custom title from
                                   char_data, but I'll just put this simple
                                   string in for debugging purposes. */
    buff = lbuff;

    for (;;) {
      if (*prompt == '&') {
        switch (*(++prompt)) {
          case 'N':
            i = GET_NAME(d->character);
          case '&':
            i = "&";
        while ((*buff = *(i++)))
      } else if (!(*(buff++) = *(prompt++)))
    write_to_descriptor(d->descriptor, CAP(lbuff));

As you can see, it's very simular to the act() procedure, however 
dubugging it is beyond me :(.

What happens is it will proceed to work for about 15 seconds to a minute, 
then all  of a sudden it will core dump and spit the following out in

#0  0x7f67d in __sfvwrite (0x00000000, 0x001e0800, 0x00000000, 0x00000000)

If you have any ideas what is causing this, I would be happy to hear 


This archive was generated by hypermail 2b30 : 12/07/00 PST